From 1769606fb4417c9d543d2e58ea9b7e435d45a5b7 Mon Sep 17 00:00:00 2001 From: Alex Shen Date: Mon, 15 Jan 2024 12:42:28 +0800 Subject: [PATCH] first commit --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) 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 +```