Skip to content
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

Run pytest after package installation #340

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,36 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup uv
- name: Setup dependencies
# Set up the virtual environment and install dev dependencies (JS & Python)
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install ".[dev]"
npm i
shell: bash
- name: Run all tests
- name: Run tests
# Run all tests before generating the distribution
run: |
source .venv/bin/activate
uv pip install ".[dev]"
pytest --headless
npm run build
npm run test
shell: bash
- name: Generate distribution
# Run setup.py to generate the distribution
run: |
source .venv/bin/activate
uv pip install -r requires-dev.txt -r requires-install.txt
npm i
npm run dist
npm pack && mv *.tgz dist/
ndrezn marked this conversation as resolved.
Show resolved Hide resolved
- name: Validate distribution
# Run tests again using the generated wheel file
run: |
uv venv test-dist
source dist/bin/activate
WHL_FILE=$(ls dist/*.whl)
uv pip install "${WHL_FILE}[dev]"
npm run test
shell: bash
- uses: ncipollo/release-action@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"private::lint.eslint": "eslint src",
"private::lint.prettier": "prettier src --list-different --ignore-path=.prettierignore",
"lint": "run-s private::lint.*",
"test": "pytest --headless",
"dist": "npm run build && run-s pre-flight-dag-version && rimraf build dist && python setup.py sdist bdist_wheel"
},
"author": "Plotly <[email protected]>",
Expand Down
Loading