Skip to content

Commit

Permalink
Create virtual environment and ignore changes to requirements file. (#…
Browse files Browse the repository at this point in the history
…412)

* This will work

* tresting

* Remove generated requirements file

* Ignore changed file

* Allow re-try of pypi release.
  • Loading branch information
delucchi-cmu authored Oct 17, 2024
1 parent 6fc2a30 commit 5717268
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit 5717268

Please sign in to comment.