-
Notifications
You must be signed in to change notification settings - Fork 1
eng: fix up project configuration - BNCH-112051 #221
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,33 +30,33 @@ jobs: | |
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/pdm.lock') }} | ||
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies | ||
- name: Install PDM | ||
run: pip install pdm | ||
- name: Install Poetry | ||
run: pip install poetry | ||
|
||
- name: Install Dependencies | ||
run: pdm install | ||
run: poetry install | ||
|
||
- name: Check formatting | ||
run: pdm run ruff format . --check | ||
run: poetry run ruff format . --check | ||
|
||
- name: Run mypy | ||
run: pdm mypy --show-error-codes | ||
run: poetry run task mypy --show-error-codes | ||
|
||
- name: Lint | ||
run: pdm run ruff check . | ||
run: poetry run ruff check . | ||
|
||
- name: Run pytest without coverage | ||
if: matrix.os != 'ubuntu-latest' | ||
run: pdm test | ||
run: poetry run task test | ||
env: | ||
TASKIPY: true | ||
|
||
- name: Run pytest with coverage | ||
if: matrix.os == 'ubuntu-latest' | ||
run: pdm test_with_coverage | ||
run: poetry run task test_with_coverage | ||
env: | ||
TASKIPY: true | ||
|
||
|
@@ -131,27 +131,31 @@ jobs: | |
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.8" | ||
python-version: "3.9" | ||
- name: Get Python Version | ||
id: get_python_version | ||
run: echo "python_version=$(python --version)" >> $GITHUB_OUTPUT | ||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/pdm.lock') }} | ||
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies | ||
# General note on this job: the main project uses poetry, but the project inside integration-tests/ | ||
# uses pdm. That's because integration-tests/ is a generated client-- the output from running the | ||
# generator on a test API spec-- and the "make a pdm project" option was used in that process. | ||
- name: Install dependencies | ||
run: | | ||
pip install poetry | ||
pip install pdm | ||
python -m venv .venv | ||
pdm install | ||
poetry install | ||
- name: Cache Generated Client Dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: integration-tests/.venv | ||
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies-${{ hashFiles('**/pdm.lock') }} | ||
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies-${{ hashFiles('**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies | ||
- name: Set httpx version | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,5 @@ my-test-api-client/ | |
custom-e2e/ | ||
3-1-features-client | ||
localtest | ||
|
||
!tests/.env |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,12 @@ | |
from .parser.errors import ErrorLevel, GeneratorError | ||
from .parser.properties import LiteralEnumProperty | ||
|
||
__version__ = version(__package__) | ||
# __version__ = version(__package__) | ||
# Benchling-specific change: the original line above won't work because the installed package name of | ||
# our fork (benchling-openapi-python-client) deliberately does not match the base module name (see | ||
# pyproject.toml) | ||
INSTALLED_PACKAGE = "benchling-openapi-python-client" | ||
__version__ = version(INSTALLED_PACKAGE) | ||
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. As noted in a comment I added to |
||
|
||
|
||
TEMPLATE_FILTERS = { | ||
|
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.
The other CI jobs were already updated to 3.9 but I missed this one.