-
Notifications
You must be signed in to change notification settings - Fork 136
fix: noxfile.py & better align it against GitHub Actions CI #2358
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
from __future__ import annotations | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
import random | ||||||||||||||||||||||||||||||||||||||||||||||||||
from textwrap import dedent | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
PANDAS_AND_NUMPY_VERSION = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||
# ("1.0.5", "1.18.5"), # fails to build in CI # noqa: ERA001 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -57,16 +58,13 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||
pandas_version, numpy_version = random.choice(PANDAS_AND_NUMPY_VERSION) | ||||||||||||||||||||||||||||||||||||||||||||||||||
polars_version = random.choice(POLARS_VERSION) | ||||||||||||||||||||||||||||||||||||||||||||||||||
pyarrow_version = random.choice(PYARROW_VERSION) | ||||||||||||||||||||||||||||||||||||||||||||||||||
requirements = dedent(f""" | ||||||||||||||||||||||||||||||||||||||||||||||||||
pandas=={pandas_version} | ||||||||||||||||||||||||||||||||||||||||||||||||||
numpy=={numpy_version} | ||||||||||||||||||||||||||||||||||||||||||||||||||
polars=={polars_version} | ||||||||||||||||||||||||||||||||||||||||||||||||||
pyarrow=={pyarrow_version} | ||||||||||||||||||||||||||||||||||||||||||||||||||
""").lstrip() | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
content = f"pandas=={pandas_version}\nnumpy=={numpy_version}\npolars=={polars_version}\npyarrow=={pyarrow_version}\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||
with open("random-requirements.txt", "w") as fd: | ||||||||||||||||||||||||||||||||||||||||||||||||||
fd.write(content) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
with open("pyproject.toml") as fd: | ||||||||||||||||||||||||||||||||||||||||||||||||||
content = fd.read() | ||||||||||||||||||||||||||||||||||||||||||||||||||
content = content.replace( | ||||||||||||||||||||||||||||||||||||||||||||||||||
'filterwarnings = [\n "error",\n]', | ||||||||||||||||||||||||||||||||||||||||||||||||||
"filterwarnings = [\n \"error\",\n 'ignore:distutils Version classes are deprecated:DeprecationWarning',\n]", | ||||||||||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
-67
to
-70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this not needed anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah thank you! I was going to leave a comment for @MarcoGorelli about this. The matching string doesn't exist in the Lines 204 to 227 in 4144497
|
||||||||||||||||||||||||||||||||||||||||||||||||||
with open("pyproject.toml", "w") as fd: | ||||||||||||||||||||||||||||||||||||||||||||||||||
fd.write(content) | ||||||||||||||||||||||||||||||||||||||||||||||||||
if __name__ == "__main__": | ||||||||||||||||||||||||||||||||||||||||||||||||||
with open("random-requirements.txt", "w") as fd: | ||||||||||||||||||||||||||||||||||||||||||||||||||
fd.write(requirements) |
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.
I noticed this too. In CI we test on python
3.9
only in therandom
test.Is it something deliberate?
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.
Tracked back to this commit: e718d1f
My guess is that it mainly reduces the time it takes for tests to run without sacrificing too much validity.
Though I'll kick this one to @MarcoGorelli as well if he remembers.