-
-
Notifications
You must be signed in to change notification settings - Fork 2
V3: Huge refactoring #115
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
Merged
V3: Huge refactoring #115
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
556cf61
remove unused decorators
LostInDarkMath a42a6b4
added task file
LostInDarkMath d2bfbf6
CI: install task
LostInDarkMath ff81141
CI: added a check that CHANGELOG.md is modified on feature branches
LostInDarkMath f9d62d7
CI: added a check that the poetry package version was updated
LostInDarkMath 0811ef0
added ruff linter and apply some lints
LostInDarkMath 67cabea
fixed some ruff lints
LostInDarkMath 50ca878
removed unused decorators
LostInDarkMath 0102ba1
removed GenericMixin.type_var
LostInDarkMath e66df11
fix ruff lints
LostInDarkMath 7e86f74
fix tests
LostInDarkMath 2002b6e
ad support for collections.abc types
LostInDarkMath 2b92481
removed composite validator
LostInDarkMath 5e3a7fc
add CRLF check
LostInDarkMath a53c660
updated dependencies and add CI check
LostInDarkMath 7d3573e
test lock file out of sync
LostInDarkMath 99bdc6e
Update poetry.lock
LostInDarkMath 24235a0
update github action checkout to v6
LostInDarkMath f11d501
update github action setup-python
LostInDarkMath 5c61578
added deptry check
LostInDarkMath 2be86f5
fix deptry
LostInDarkMath a3b1d2b
refactor @trace
LostInDarkMath d6a3cb9
refactor decorators
LostInDarkMath cf252f1
update README and packages
LostInDarkMath 3ce4e0e
cleanup
LostInDarkMath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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,56 +1,114 @@ | ||
| name: Python Tests | ||
|
|
||
| on: | ||
| push: | ||
| push: | ||
| branches: | ||
| - '*' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| feature-branch-checks: | ||
| # these checks do not run this on master itself | ||
| if: github.ref != 'refs/heads/master' | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 # we need history to diff properly | ||
|
|
||
| - &install-task # define a YAML anchor to re-use this task in other jobs | ||
| name: Install task to make use of Taskfile.yml | ||
| run: | | ||
| sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin | ||
| task --version | ||
|
|
||
| - name: Check for CRLF line endings | ||
| run: | | ||
| task list-crlf | ||
|
|
||
| - name: Check poetry.lock is up to date | ||
| run: | | ||
| pip install poetry | ||
| task check-lock | ||
|
|
||
| - name: Check dependencies in pyproject.toml have no issues | ||
| run: | | ||
| task dependencies-with-pip | ||
| task check-deps | ||
|
|
||
| - name: Verify CHANGELOG.md was updated | ||
| run: | | ||
| task check-changelog | ||
|
|
||
| - name: Verify that the package version was updated. This is needed because master is automatically deployed to pypi.org | ||
| run: | | ||
| task check-version | ||
|
|
||
| - name: Run code linter | ||
| run: | | ||
| pip install ruff | ||
| task lint | ||
|
|
||
| test: | ||
| needs: feature-branch-checks | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: [3.11, 3.12, 3.13, 3.14] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| check-latest: true | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -U coveralls | ||
| pip install -e .[dev] | ||
| - name: Run tests with pytest | ||
| run: | | ||
| pytest --doctest-modules --cov=pedantic --cov-branch --cov-report= --cov-report=term | ||
| - name: Coveralls | ||
| uses: coverallsapp/github-action@v2.3.6 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| file: .coverage | ||
| deploy: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| if: github.ref == 'refs/heads/master' | ||
| environment: | ||
| name: pypi-deployment | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.12 | ||
| - name: Install Build Tools | ||
| run: | | ||
| pip install -U build twine | ||
| - name: Set Twine Environment Variables | ||
| run: | | ||
| echo "TWINE_USERNAME=${{ secrets.PYPI_USERNAME }}" >> $GITHUB_ENV | ||
| echo "TWINE_PASSWORD=${{ secrets.PYPI_PASSWORD }}" >> $GITHUB_ENV | ||
| - name: Build and Upload to PyPI | ||
| run: | | ||
| python -m build | ||
| twine upload dist/* | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| check-latest: true | ||
|
|
||
| - *install-task # see above | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| task dependencies-with-pip | ||
| pip install -U coveralls | ||
|
|
||
| - name: Run tests with pytest | ||
| run: | | ||
| task tests-with-cov | ||
|
|
||
| - name: Coveralls | ||
| uses: coverallsapp/github-action@v2.3.6 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| file: .coverage | ||
|
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| deploy: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| if: github.ref == 'refs/heads/master' | ||
| environment: | ||
| name: pypi-deployment | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: 3.12 | ||
|
|
||
| - name: Install Build Tools | ||
| run: | | ||
| pip install -U build twine | ||
|
|
||
| - name: Set Twine Environment Variables | ||
| run: | | ||
| echo "TWINE_USERNAME=${{ secrets.PYPI_USERNAME }}" >> $GITHUB_ENV | ||
| echo "TWINE_PASSWORD=${{ secrets.PYPI_PASSWORD }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Build and Upload to PyPI | ||
| run: | | ||
| python -m build | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| twine upload dist/* | ||
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.