Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Dec 11, 2024
1 parent 11f5713 commit 584dc38
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 62 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ jobs:
uv sync --all-extras --dev
- name: Run pre-commit
run: uvx pre-commit run --all-files
- name: Check types in test.py
run: |
uv build --wheel
OUTPUT=`uvx --with dist/*.whl mypy test.py || true`
echo $OUTPUT
if [[ ${OUTPUT} != *"Found 1 error"* ]];then
echo "Stubs test failed: $TEST"
exit 1
fi
- name: Stubs consistency check
if: ${{ matrix.check-consistency }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish_on_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ jobs:
git push
- name: Publish to PyPI
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
rm -rf dist/* || true
uv build --sdist --wheel --no-sources
# uv publish
uvx twine upload dist/*.whl dist/*.tar.gz -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} --skip-existing
uvx twine upload --non-interactive dist/*
- name: Report status
uses: actions/github-script@v7
with:
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ repos:
language: system
pass_filenames: false
entry: uv run mypy awscrt-stubs
- id: sanity
name: sanity
language: system
pass_filenames: false
entry: ./scripts/sanity_check.sh
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]


[dependency-groups]
dev = ["setuptools", "awscrt", "mypy", "pyright", "istub"]

[tool.uv]
config-settings = { editable-mode = "strict" }
dev-dependencies = ["setuptools", "awscrt", "mypy", "pyright", "istub"]

[project.urls]
Homepage = "https://github.com/youtype/types-awscrt"
Expand All @@ -44,7 +47,7 @@ requires = ['setuptools']
build-backend = 'setuptools.build_meta'

[tool.setuptools]
packages = ["awscrt-stubs", "awscrt-stubs.eventstream"]
packages = ["awscrt-stubs"]

[tool.pyright]
include = ["awscrt-stubs"]
Expand Down
11 changes: 11 additions & 0 deletions scripts/sanity_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e

rm -rf dist/*
uv build --wheel
OUTPUT=`uvx --with dist/*.whl mypy test.py || true`
echo $OUTPUT
if [[ ${OUTPUT} != *"Found 1 error"* ]];then
echo "Stubs test failed: $TEST"
exit 1
fi
Loading

0 comments on commit 584dc38

Please sign in to comment.