Repository navigation
Feature/refactor #160
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
Feature/refactor #160
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
2996f70
refactoring
alex98247 2aacf99
Merge branch 'refs/heads/main' into feature/refactor
alex98247 cfc95a5
refactoring
alex98247 5fc6be2
refactoring
alex98247 da33c25
Merge branch 'main' into feature/refactor
alex98247 6e6c176
refactor
alex98247 52b4cb5
refactor
alex98247 d345cfa
refactor
alex98247 5e4d252
refactor
alex98247 84e36c1
refactor
alex98247 f1865e8
refactor
alex98247 75d1445
refactor
alex98247 9c63313
refactor
alex98247 4b94b99
refactor
alex98247 36efa25
refactor
alex98247 bb31306
refactor
alex98247 12cc981
refactor
alex98247 a115a4b
refactor
alex98247 c78134a
refactor
alex98247 23c4f4d
refactor
alex98247 8a1f5ec
refactor
alex98247 bdddc2a
refactor
alex98247 22f412d
refactor
alex98247 6beb601
refactor
alex98247 d4e9f51
refactor
alex98247 dade567
refactor
alex98247 f728c5b
refactor
alex98247 0ff5995
refactor
alex98247 37aaf2b
refactor
alex98247 3926a15
refactor
alex98247 1943aa8
refactor
alex98247 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 +1,2 @@ | ||
| MOR | ||
| theses |
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,3 +1,11 @@ | ||
| [run] | ||
| branch = true | ||
| source = pysatl_criterion | ||
| omit = | ||
| tests/* | ||
|
|
||
| [report] | ||
| show_missing = true | ||
| precision = 2 | ||
| # The measured combined statement/branch baseline is 82.08%. | ||
| fail_under = 80 |
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 |
|---|---|---|
|
|
@@ -29,10 +29,13 @@ jobs: | |
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install Poetry | ||
| run: pip install poetry==2.1.1 | ||
| run: pip install poetry==2.4.1 | ||
|
|
||
| - name: Install dynamic versioning plugin | ||
| run: poetry self add poetry-dynamic-versioning[plugin] | ||
| - name: Validate locked dependencies | ||
| run: poetry check --lock | ||
|
|
||
| - name: Install dependencies with Poetry | ||
| run: poetry sync --only main,lint,test | ||
|
|
||
| - name: Build distribution | ||
| run: poetry build | ||
|
|
@@ -43,9 +46,6 @@ jobs: | |
| - name: Display Python version | ||
| run: python -c "import sys; print(sys.version)" | ||
|
|
||
| - name: Install dependencies with Poetry | ||
| run: poetry install --with dev | ||
|
|
||
| - name: Run Ruff lint | ||
| run: poetry run ruff check --output-format=github | ||
|
|
||
|
|
@@ -57,12 +57,22 @@ jobs: | |
| poetry run mypy src/pysatl_criterion tests | ||
|
|
||
| - name: Run tests | ||
| run: poetry run pytest --random-order | ||
| if: matrix.python-version != '3.12' | ||
| run: poetry run pytest --random-order --junitxml=${{ runner.temp }}/pytest-results.xml | ||
|
|
||
| - name: Tests with Coveralls | ||
| if: (runner.os == 'Linux' && matrix.python-version == '3.12') | ||
| run: | | ||
| poetry run pytest --random-order --cov=pysatl_criterion --cov-config=.coveragerc | ||
| poetry run pytest --random-order --cov=pysatl_criterion --cov-config=.coveragerc --cov-report=term-missing --cov-report=xml --junitxml=${{ runner.temp }}/pytest-results.xml | ||
|
|
||
| - name: Upload test reports | ||
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: test-reports-python-${{ matrix.python-version }} | ||
| path: | | ||
| ${{ runner.temp }}/pytest-results.xml | ||
| coverage.xml | ||
|
Comment on lines
+69
to
+75
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
|
|
||
| - name: Coveralls | ||
| if: (runner.os == 'Linux' && matrix.python-version == '3.12') | ||
|
|
@@ -72,9 +82,6 @@ jobs: | |
| # Allow failure for coveralls | ||
| poetry run coveralls || true | ||
|
|
||
| - name: Remove poetry.lock before checking for changes | ||
| run: rm -f poetry.lock | ||
|
|
||
| - name: Check for repository changes | ||
| run: | | ||
| if [ -n "$(git status --porcelain)" ]; then | ||
|
|
@@ -98,7 +105,14 @@ jobs: | |
| - uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.12" | ||
| - uses: pre-commit/action@v3.0.1 | ||
| - name: Install Poetry | ||
| run: pip install poetry==2.4.1 | ||
| - name: Validate locked dependencies | ||
| run: poetry check --lock | ||
| - name: Install dependencies | ||
| run: poetry sync --only main,lint,test | ||
| - name: Run pre-commit | ||
| run: poetry run pre-commit run --all-files --show-diff-on-failure | ||
|
|
||
|
|
||
| build: | ||
|
|
@@ -118,11 +132,11 @@ jobs: | |
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Build distribution | ||
| run: pip install poetry==2.1.1 | ||
| - name: Install Poetry | ||
| run: pip install poetry==2.4.1 | ||
|
|
||
| - name: Install dynamic versioning plugin | ||
| run: poetry self add poetry-dynamic-versioning[plugin] | ||
| - name: Validate locked dependencies | ||
| run: poetry check --lock | ||
|
|
||
| - name: Build distribution | ||
| run: poetry build | ||
|
|
||
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
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
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,85 @@ | ||
| name: Statistical and database validation | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 3 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| statistical: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.12" | ||
| - run: pip install poetry==2.4.1 | ||
| - run: poetry sync --only main,test | ||
| - name: Validate level and power with independent simulation samples | ||
| env: | ||
| PYSATL_STATISTICAL: "1" | ||
| PYSATL_MULTIPLE_TESTING_MONTE_CARLO: "1" | ||
| run: >- | ||
| poetry run pytest -m statistical --random-order | ||
| --junitxml=${{ runner.temp }}/statistical.xml | ||
| - uses: actions/upload-artifact@v7 | ||
| if: always() | ||
| with: | ||
| name: statistical-results | ||
| path: ${{ runner.temp }}/statistical.xml | ||
|
|
||
| databases: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| services: | ||
| postgres: | ||
| image: postgres:16 | ||
| env: | ||
| POSTGRES_USER: criterion | ||
| POSTGRES_PASSWORD: criterion | ||
| POSTGRES_DB: criterion | ||
| ports: | ||
| - 5432:5432 | ||
| options: >- | ||
| --health-cmd "pg_isready -U criterion" | ||
| --health-interval 10s --health-timeout 5s --health-retries 10 | ||
| mysql: | ||
| image: mysql:8.4 | ||
| env: | ||
| MYSQL_ROOT_PASSWORD: criterion | ||
| MYSQL_ROOT_HOST: "%" | ||
| MYSQL_DATABASE: criterion | ||
| ports: | ||
| - 3306:3306 | ||
| options: >- | ||
| --health-cmd "mysqladmin ping -h localhost -pcriterion" | ||
| --health-interval 10s --health-timeout 5s --health-retries 20 | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.12" | ||
| - run: pip install poetry==2.4.1 | ||
| - run: poetry sync --only main,test | ||
| - name: Install optional MySQL integration driver | ||
| run: poetry run python -m pip install 'PyMySQL[rsa]==1.1.2' | ||
| - name: Check real database transactions and concurrent writers | ||
| env: | ||
| CRITERION_TEST_POSTGRES_URL: postgresql+psycopg2://criterion:criterion@127.0.0.1:5432/criterion | ||
| CRITERION_TEST_MYSQL_URL: mysql+pymysql://root:criterion@127.0.0.1:3306/criterion | ||
| run: >- | ||
| poetry run pytest tests/persistence tests/loader --random-order | ||
| --junitxml=${{ runner.temp }}/databases.xml | ||
| - uses: actions/upload-artifact@v7 | ||
| if: always() | ||
| with: | ||
| name: database-results | ||
| path: ${{ runner.temp }}/databases.xml |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?