-
Notifications
You must be signed in to change notification settings - Fork 176
Fix handling of _version.py file #187
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
Fix handling of _version.py file #187
Conversation
test_dist: | ||
needs: [build_dist] | ||
name: Test Distribution Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
# Build sdist on lowest supported Python | ||
python-version: '3.9' | ||
|
||
- name: Download the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-${{ github.run_id }} | ||
path: dist/ | ||
|
||
- name: Test the sdist | ||
run: | | ||
cd dist | ||
pip install *.tar.gz | ||
python -c "import flask_pymongo" | ||
pip uninstall -y flask_pymongo | ||
|
||
- name: Test the wheel | ||
run: | | ||
cd dist | ||
pip install *.whl | ||
python -c "import flask_pymongo" | ||
pip uninstall -y flask_pymongo |
Check warning
Code scanning / zizmor
overly broad permissions Warning
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.
What is this alert for?
test_dist: | ||
needs: [build_dist] | ||
name: Test Distribution Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
# Build sdist on lowest supported Python | ||
python-version: '3.9' | ||
|
||
- name: Download the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-${{ github.run_id }} | ||
path: dist/ | ||
|
||
- name: Test the sdist | ||
run: | | ||
cd dist | ||
pip install *.tar.gz | ||
python -c "import flask_pymongo" | ||
pip uninstall -y flask_pymongo | ||
|
||
- name: Test the wheel | ||
run: | | ||
cd dist | ||
pip install *.whl | ||
python -c "import flask_pymongo" | ||
pip uninstall -y flask_pymongo |
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.
What is this alert for?
@@ -6,8 +6,6 @@ _build | |||
dist/ | |||
*.pyc | |||
.pytest_cache/ | |||
_version.py | |||
version.txt |
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.
So these files are untracked but expected to be included in the distribution? How do we prevent committing them?
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.
This repo used to use setuptools-scm. Now that we use hatch, we want the version file to be there.
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.
Shouldn't this PR be adding the file in that case?
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 file was already there, hatch uses .gitignore
to determine what goes into the dist by default, unless you override it.
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.
Oh I see the file already exists. I forgot you could commit a .gitignore file.
Fixes #186. Hatch was using the
.gitignore
file to determine which files to include in the dists.