generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 24
Replace pants with uv and simplify development workflow #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JordonPhillips
merged 8 commits into
smithy-lang:haydenbaker/reorg-structure
from
haydenbaker:haydenbaker/reorg-python
Feb 25, 2025
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
05d2ffb
Replace pants with uv, reorganize python setup
haydenbaker 14e5c3d
appease pyright (for now...)
haydenbaker bc3018f
Simplify CI, add coverage, black, and rules
haydenbaker e996962
Update hatch dist configuration
haydenbaker 91fd3d0
Update repo documentation
haydenbaker 9c09089
Add formatting check, run it
haydenbaker 504949f
Update package tomls
haydenbaker fc03d0a
Use matrix for the ci job
haydenbaker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,115 +1,57 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - develop | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
|
|
||
| env: | ||
| UV_SYSTEM_PYTHON: true | ||
|
|
||
| jobs: | ||
| test: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.12"] | ||
|
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python for CI - ${{ matrix.python-version }} | ||
| - name: Set up Python 3.12 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Initialize Pants | ||
| uses: pantsbuild/actions/init-pants@main | ||
| with: | ||
| # cache0 makes it easy to bust the cache if needed | ||
| # just increase the integer to start with a fresh cache | ||
| gha-cache-key: cache0-py${{ matrix.python_version }} | ||
| named-caches-hash: ${{ hashFiles('python-default.lock') }} | ||
| pants-ci-config: pants.ci.toml | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| make test-py | ||
| - name: Upload coverage | ||
| if: matrix.python-version == 3.12 | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| file: ./dist/coverage/python/coverage.xml | ||
| flags: unittests | ||
| name: codecov-umbrella | ||
| fail_ci_if_error: true | ||
|
|
||
|
|
||
| test-codegen: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.12"] | ||
|
|
||
| name: Codegen Java 17 / Python ${{ matrix.python-version }} | ||
|
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Download Corretto 17 JDK | ||
| run: | | ||
| download_url="https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz" | ||
| wget -O $RUNNER_TEMP/java_package.tar.gz $download_url | ||
| - name: Set up Corretto 17 JDK | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'jdkfile' | ||
| jdkFile: ${{ runner.temp }}/java_package.tar.gz | ||
| java-version: 17 | ||
| architecture: x64 | ||
| distribution: 'corretto' | ||
|
|
||
| - name: clean and build without python | ||
| run: cd codegen && ./gradlew clean build | ||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
|
|
||
| - name: Set Up Python for CI - ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Initialize Pants | ||
| uses: pantsbuild/actions/init-pants@main | ||
| with: | ||
| # cache0 makes it easy to bust the cache if needed | ||
| gha-cache-key: cache0-py${{ matrix.python_version }} | ||
| named-caches-hash: ${{ hashFiles('python-default.lock') }} | ||
| pants-ci-config: pants.ci.toml | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
|
|
||
| - name: Install smithy-python | ||
| - name: Setup workspace | ||
| run: | | ||
| make install-python-components | ||
| export UV_PROJECT_ENVIRONMENT="${pythonLocation}" | ||
| echo "UV_PROJECT_ENVIRONMENT=$UV_PROJECT_ENVIRONMENT" >> "$GITHUB_ENV" | ||
| make install | ||
| - name: clean and build without formatting/linting installed | ||
| run: cd codegen && ./gradlew clean build | ||
| - name: Check python packages | ||
| run: | | ||
| make check-py | ||
| - name: Install black | ||
| - name: Test python packages | ||
| run: | | ||
| python${{ matrix.python-version }} -m pip install --upgrade black | ||
| make test-py | ||
| - name: clean and build without linting installed | ||
| run: cd codegen && ./gradlew clean build | ||
| - name: Build python packages | ||
| run: | | ||
| make build-py | ||
| - name: Install mypy and other libraries necessary for typing | ||
| - name: Build (and test) java packages | ||
| run: | | ||
| python${{ matrix.python-version }} -m pip install --upgrade mypy pytest pytest-asyncio | ||
| make build-java | ||
| - name: clean and build with all optional tools installed | ||
| run: cd codegen && ./gradlew clean build | ||
| - name: Run protocol tests | ||
| run: | | ||
| make test-protocols | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.12 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.