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

Create virtual environment and ignore changes to requirements file. #412

Merged
merged 5 commits into from
Oct 17, 2024
Merged
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
12 changes: 8 additions & 4 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ name: Upload Python Package
on:
release:
types: [published]

workflow_dispatch:

permissions:
contents: read

Expand All @@ -32,15 +33,18 @@ jobs:
python -m pip install --upgrade pip
- name: Create lock requirements file in virtual environment
run: |
. .venv/bin/activate
python -m venv .venv
source .venv/bin/activate
python -m pip install .
python -m pip list --format=freeze --exclude "hats-import" > requirements.txt
python -m pip list --format=freeze --exclude "hats-import" --exclude pip > requirements.txt
python -m pip install .[dev]
python -m pytest tests
python -m pip uninstall -y hats-import
- name: Install build tools
run: pip install build
- name: Build package
run: python -m build
run: |
git update-index --assume-unchanged requirements.txt
python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
Loading