Commit ced14805 authored by Eric Duminil's avatar Eric Duminil
Browse files

Refactor with tokens

parent 0d3feada
...@@ -30,10 +30,15 @@ _check_upload: ...@@ -30,10 +30,15 @@ _check_upload:
@echo -n "Are you sure you want to upload the package to PyPI? [y/N] " && read ans && [ $${ans:-N} = y ] @echo -n "Are you sure you want to upload the package to PyPI? [y/N] " && read ans && [ $${ans:-N} = y ]
upload_package_to_testpypi: _check_upload build ## Upload PyPI package to https://test.pypi.org/ upload_package_to_testpypi: _check_upload build ## Upload PyPI package to https://test.pypi.org/
uv publish --publish-url https://test.pypi.org/legacy/ $(MAKE) _upload SERVER=testpypi URL=https://test.pypi.org/legacy/
upload_package_to_pypi: _check_upload build ## Upload PyPI package to https://pypi.org/ upload_package_to_pypi: _check_upload build ## Upload PyPI package to https://pypi.org/
uv publish $(MAKE) _upload SERVER=pypi
_upload:
@token=$$(python3 -c "import configparser, os; c=configparser.ConfigParser(); c.read(os.path.expanduser('~/.pypirc')); print(c.get('$(SERVER)', 'password', fallback=''))"); \
[ -n "$$token" ] || { echo "No token found for [$(SERVER)] in ~/.pypirc"; exit 1; }; \
UV_PUBLISH_TOKEN=$$token uv publish --verbose $(if $(URL),--publish-url $(URL),)
install_editable: ## Install package in dev mode install_editable: ## Install package in dev mode
pip install -e . pip install -e .
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment