diff --git a/README.md b/README.md index e69de29..a4b9bb3 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,38 @@ +# This is a demo project for publishing a python package to gitea. + +1. Generate your `auth token` at [gitea](https://gitea.sparkle-in-tech.com/): + +``` +Profile -> Settings -> Applications -> Token Name -> Generate Token +``` + +Copy your token, note that the token value will only be shown to you once. + +2. To register the package registry you need to edit your local `~/.pypirc` file. Add + +``` +[distutils] +index-servers = gitea + +[gitea] +repository = https://gitea.example.com/api/packages/{owner, eg., Sparkle-Techbank}/pypi +username = {your gitea username, eg., vincent} +password = {token generated from last step} +``` + +3. Publish a package + +``` +python -m twine upload --repository gitea dist/testpythonpackaging-0.0.1.tar.gz +``` + +4. Go to the owner site eg, for this test project the owner is alex, and click on `package` + https://gitea.sparkle-in-tech.com/alex/-/packages + +5. Click on the package you just created and uploaded and then click on `Settings` +6. Link the package to your project repository so it will show up correctly! +7. Use the following command to install a python package + +``` +pip install --extra-index-url https://gitea.sparkle-in-tech.com/api/packages/alex/pypi/simple testpythonpackaging +```