Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,40 @@
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install pypa/build
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install build pipenv tox --user

- name: Build a binary wheel and a source tarball
run: |
pipenv --python 3.11
make build

- name: tox
run: >-
tox
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install pypa/build
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install build uv tox --user

- name: Build a binary wheel and a source tarball
run: |
uv python pin 3.11
make build

- name: tox
run: >-
tox

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Publish Python 🐍 distributions 📦 to PyPI and TestPyPI' step
Uses Step
uses 'pypa/gh-action-pypi-publish' with ref 'release/v1', not a pinned commit hash
with:
skip-existing: true
verbose: true
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Publish Python 🐍 distributions 📦 to PyPI and TestPyPI' step
Uses Step
uses 'pypa/gh-action-pypi-publish' with ref 'release/v1', not a pinned commit hash
with:
skip-existing: true
verbose: true
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
with:
python-version: "3.9"

# Install pipenv
- name: Install pipenv
run: pip install pipenv
# Install uv
- name: Install uv
run: pip install uv

# Pack and publish Python SDK
- name: Exec py client unit test
Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ PIPY_URL ?= https://upload.pypi.org/legacy/
TOKEN ?=
VERSION := $(shell cat VERSION | tr -d '\n')

proto:
pipenv sync --dev
pipenv run python -m grpc_tools.protoc -Iamaas/grpc/protos=./protos \
version:
sed "s/_VERSION_/'"$(VERSION)"'/g" pyproject.toml > pyproject.tmp && mv pyproject.tmp pyproject.toml
echo "Version set to $(VERSION)"

proto: version
uv sync --dev
uv run python -m grpc_tools.protoc -Iamaas/grpc/protos=./protos \
--python_out=. \
--pyi_out=. \
--grpc_python_out=. \
./protos/scan.proto

build: proto
pipenv run pipenv-setup sync
pipenv run python setup.py sdist bdist_wheel
uv run python -m build --sdist --wheel

test: proto
pipenv run pytest tests
uv run pytest tests

upload:
pipenv run twine upload --repository-url $(PIPY_URL) -u __token__ -p $(TOKEN) ./dist/*.whl --skip-existing
uv run twine upload --repository-url $(PIPY_URL) -u __token__ -p $(TOKEN) ./dist/*.whl --skip-existing

clean:
@rm -rf dist build *.egg-info amaas/grpc/protos/
21 changes: 0 additions & 21 deletions Pipfile

This file was deleted.

828 changes: 0 additions & 828 deletions Pipfile.lock

This file was deleted.

Loading
Loading