code.gitea.io/gitea@v1.22.3/docs/content/usage/packages/conda.en-us.md (about) 1 --- 2 date: "2022-12-28T00:00:00+00:00" 3 title: "Conda Package Registry" 4 slug: "conda" 5 sidebar_position: 25 6 draft: false 7 toc: false 8 menu: 9 sidebar: 10 parent: "packages" 11 name: "Conda" 12 sidebar_position: 25 13 identifier: "conda" 14 --- 15 16 # Conda Package Registry 17 18 Publish [Conda](https://docs.conda.io/en/latest/) packages for your user or organization. 19 20 ## Requirements 21 22 To work with the Conda package registry, you need to use [conda](https://docs.conda.io/projects/conda/en/stable/user-guide/install/index.html). 23 24 ## Configuring the package registry 25 26 To register the package registry and provide credentials, edit your `.condarc` file: 27 28 ```yaml 29 channel_alias: https://gitea.example.com/api/packages/{owner}/conda 30 channels: 31 - https://gitea.example.com/api/packages/{owner}/conda 32 default_channels: 33 - https://gitea.example.com/api/packages/{owner}/conda 34 ``` 35 36 | Placeholder | Description | 37 | ------------ | ----------- | 38 | `owner` | The owner of the package. | 39 40 See the [official documentation](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html) for explanations of the individual settings. 41 42 If you need to provide credentials, you may embed them as part of the channel url (`https://user:password@gitea.example.com/...`). 43 44 ## Publish a package 45 46 To publish a package, perform a HTTP PUT operation with the package content in the request body. 47 48 ``` 49 PUT https://gitea.example.com/api/packages/{owner}/conda/{channel}/{filename} 50 ``` 51 52 | Placeholder | Description | 53 | ------------ | ----------- | 54 | `owner` | The owner of the package. | 55 | `channel` | The [channel](https://conda.io/projects/conda/en/latest/user-guide/concepts/channels.html) of the package. (optional) | 56 | `filename` | The name of the file. | 57 58 Example request using HTTP Basic authentication: 59 60 ```shell 61 curl --user your_username:your_password_or_token \ 62 --upload-file path/to/package-1.0.conda \ 63 https://gitea.example.com/api/packages/testuser/conda/package-1.0.conda 64 ``` 65 66 If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. 67 68 You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. 69 70 The server responds with the following HTTP Status codes. 71 72 | HTTP Status Code | Meaning | 73 | ----------------- | ------- | 74 | `201 Created` | The package has been published. | 75 | `400 Bad Request` | The package is invalid. | 76 | `409 Conflict` | A package file with the same combination of parameters exists already. | 77 78 ## Install a package 79 80 To install a package from the package registry, execute one of the following commands: 81 82 ```shell 83 conda install {package_name} 84 conda install {package_name}={package_version} 85 conda install -c {channel} {package_name} 86 ``` 87 88 | Parameter | Description | 89 | ----------------- | ----------- | 90 | `package_name` | The package name. | 91 | `package_version` | The package version. | 92 | `channel` | The channel of the package. (optional) |