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

gh-468: fix virtualenv in testing #471

Merged
merged 17 commits into from
Jan 20, 2025
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
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Cache nox
uses: actions/cache@v4
with:
key: test-${{ hashFiles('pyproject.toml') }}
key: test-${{ hashFiles('pyproject.toml') }}-${{ env.pythonLocation }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird. I have never encountered this bug before.

path: .nox

- name: Set up Python
Expand All @@ -51,6 +51,9 @@ jobs:
- name: Install nox and coverage.py
run: python -m pip install coverage[toml] nox

- name: Install ubuntu dependencies for fitsio
run: sudo apt-get install -y libbz2-dev

- name: Run doctests
run: nox -s doctests-${{ matrix.python-version }} --verbose
env:
Expand Down
6 changes: 5 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
import nox

# Options to modify nox behaviour
nox.options.default_venv_backend = "uv|virtualenv"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed my issues locally using uv astral-sh/uv#6579

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember we could not use uv because of astral-sh/uv#1794

I am surprised that it is working now. We still use the --prefer-binary flag in our tests -

--prefer-binary

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But locally I'm not. With my uv environments locally it was failing without this. I'm not using the test-constraints.txt file.

nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ["lint", "tests"]
nox.options.sessions = [
"lint",
"tests",
]

ALL_PYTHON = [
"3.10",
Expand Down
Loading