-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Migrate from tox 3.28
to nox
#3005
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## develop #3005 +/- ##
========================================
Coverage 99.71% 99.71%
========================================
Files 248 248
Lines 18738 18738
========================================
Hits 18684 18684
Misses 54 54 ☔ View full report in Codecov by Sentry. |
There was also a discussion on switching from |
Yes @agriyakhetarpal, |
For the test suite, I was also looking at this library called I was trying to get this set up locally some time ago but I could not get anything concrete so as to push changes. Maybe you can look into this, we might be able to bring CI time down on Linux as well with this by running |
83636f5
to
a4a63ca
Compare
tox 3.28
to tox>4
tox 3.28
to tox>4
or nox
tox 3.28
to tox>4
or nox
tox 3.28
to nox
Apologies for the delay in response @agriyakhetarpal, will surely give it a try. Thankfully, for now almost everything has been migrated to |
Though I cannot review or approve the PR, looks good to me! You also probably need to rewrite the documentation to change all instances of |
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.
Taking a quick look, this looks amazing, and the CI is passing too. I'll review this in a few days!
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.
Amazing work, thanks, @arjxn-py! Some quick comments below. Could you also completely remove the tox.ini
file and check if the workflows still pass? I'll have another look on this in a while and try running the testing suite locally with nox
.
@Saransh-cpp here are the scheduled test logs after the latest changes. |
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.
coverage.py
reads these parameters from configuration files; such as setup.cfg
, or tox.ini
through the [coverage:run]
section header (coverage docs). But it doesn't read from noxfile.py
yet (I guess). So we need to create a .coveragerc
configuration file in the root folder with these options:
[run]
source = pybamm
concurrency = multiprocessing
or one may pass it as a command-line argument via --concurrency=multiprocessing
. Apparently, we can't pass --source
as an argument, so a new configuration file should be the way to go. These parameters were not found when tox.ini
was deleted
Thanks @agriyakhetarpal, really so nice of you. |
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.
Thanks, @arjxn-py and @agriyakhetarpal! Looks much better! Some comments below. Also, @arjxn-py, you might have to merge the develop branch to get all the changes Agriya has recently made into your PR.
Also, we still need some more
|
Yes @agriyakhetarpal I am still making those sessions. |
I have plans to open a PR to cache these environments, you may add that too to the list |
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 ran this locally on macOS; all commands worked as expected, except for a few:
-
It would be great if there were a way to make
nox -s dev
run likenox -s dev --verbose
by default, otherwise, just the messagenox > Session dev was successful.
is displayed and no package installation logs are shown in the command line -
Running the unit tests with
nox -s unit
skipped 50 tests: 27 becausescikits.odes
was not installed and 23 becausejax
was not installed. Should we install them on macOS too? (looks like they were skipped in CI as well) -
The
nox -e docs
command was not successful becausesphinx-autobuild
was not installed (which is weird since it worked fine when I tested it earlier). We should add it in thedocs
extras insetup.py
-
If
nox -s pybamm-requires
is executed again, it gives another error:OSError: [Errno 66] Directory not empty: './pybind11'
. We can do this, rather:
if not os.path.exists("./pybind11"):
session.run("git", "clone", "https://github.com/pybind/pybind11.git", "pybind11/", external=True,)
- L13 in
noxfile.py
if sys.platform != "win32" or sys.platform != "darwin":
Here, or sys.platform != "darwin"
is redundant—because we want nox -s pybamm-requires
to not run on just Windows, and to run on both other platforms. We can just use either if sys.platform != "win32"
or use if sys.platform == "darwin" or sys.platform == "linux"
(both are the same). Another reason why this is currently redundant is that it has a logical error; an or
Boolean operator rather than an and
operator – if in any case we had to exclude macOS here, we would have had to use and
(De Morgan's laws 😄). For Windows users, we could throw an error too instead, notifying them that the command is available on Linux and macOS only. This way nox
will avert creating a futile environment altogether
Thanks @Saransh-cpp @agriyakhetarpal for the detailed review, I'll look into the suggested things. |
As far as I remember we were doing the same with |
I see, on a fresh PyBaMM installation on macOS with |
I'm not sure how it is installing |
I double-checked to be sure, yes... and I always delete the |
We discussed this, but to make this PR concise (it already has 100+ comments haha), we decided to just mirror the |
My bad, sorry both. |
Now that I am installing unit-!windows-!mac: sh -c "pybamm_install_jax"
!windows-!mac: scikits.odes These tests are getting skipped with |
I think you misread my comment @arjxn-py. We can skip installing |
381e37c
to
33e1229
Compare
@arjxn-py were these review points resolved? |
Yes @Saransh-cpp resolved. |
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.
Looks perfect now, thanks @arjxn-py 🙂
Will merge this tonight if there are no blockers
commit e87c542 Merge: 68f8a53 0587bdb Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Tue Jun 27 10:46:15 2023 -0400 Merge pull request pybamm-team#3069 from pybamm-team/pre-commit-ci-update-config chore: update pre-commit hooks commit 68f8a53 Merge: 8f3a4d9 d526dfc Author: Saransh Chopra <saransh0701@gmail.com> Date: Tue Jun 27 10:38:16 2023 -0400 Merge pull request pybamm-team#3005 from arjxn-py/Migrate-to-tox4 Migrate from `tox 3.28` to `nox` commit 0587bdb Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue Jun 27 01:26:23 2023 +0000 chore: update pre-commit hooks updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.272 → v0.0.275](astral-sh/ruff-pre-commit@v0.0.272...v0.0.275) commit 8f3a4d9 Merge: 6995d98 ca9b86c Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Mon Jun 26 20:30:49 2023 -0400 Merge pull request pybamm-team#3064 from pybamm-team/all-contributors/add-js1tr3 docs: add js1tr3 as a contributor for code, and ideas commit 6995d98 Merge: bf85811 a121ec3 Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Mon Jun 26 20:30:36 2023 -0400 Merge pull request pybamm-team#2580 from js1tr3/split_SOC_and_Vlimits Split soc and vlimits commit d526dfc Author: Saransh Chopra <saransh0701@gmail.com> Date: Mon Jun 26 18:55:27 2023 -0400 Update noxfile.py commit a121ec3 Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Mon Jun 26 14:42:28 2023 -0400 Update index.rst commit be8bea6 Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Fri Jun 23 20:52:32 2023 -0400 fix test commit 1433dda Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Fri Jun 23 17:36:45 2023 -0400 rename for consistency commit ca9b86c Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri Jun 23 19:15:58 2023 +0000 docs: update .all-contributorsrc [skip ci] commit 14f5da0 Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri Jun 23 19:15:57 2023 +0000 docs: update README.md [skip ci] commit 78c7149 Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Fri Jun 23 15:14:58 2023 -0400 coverage commit 1db00f9 Merge: 5e36aba 788ab6e Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Fri Jun 23 11:48:19 2023 -0400 Merge branch 'develop' into split_SOC_and_Vlimits commit 5e36aba Author: Valentin Sulzer <valentinsulzer@hotmail.com> Date: Fri Jun 23 11:47:16 2023 -0400 revert notebook change commit 9339efe Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Jun 23 15:19:12 2023 +0000 style: pre-commit fixes commit ca2aa25 Author: arjxn.py <arjxn.py@gmail.com> Date: Fri Jun 23 20:48:44 2023 +0530 Throwing error for windows commit d95e087 Merge: 33e1229 bf85811 Author: arjxn.py <arjxn.py@gmail.com> Date: Wed Jun 21 21:24:34 2023 +0530 Merge branch 'develop' into Migrate-to-tox4 commit 33e1229 Author: arjxn.py <arjxn.py@gmail.com> Date: Mon Jun 19 22:00:43 2023 +0530 Skip installing odes on macos commit 213b9bf Author: arjxn.py <arjxn.py@gmail.com> Date: Mon Jun 19 20:45:20 2023 +0530 Fix skipping tests for macos commit 7d8eaa6 Merge: 5c35899 48e81e3 Author: Arjun <arjxn.py@gmail.com> Date: Mon Jun 19 20:38:55 2023 +0530 Merge branch 'develop' into Migrate-to-tox4 commit 5c35899 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun Jun 18 06:47:06 2023 +0000 style: pre-commit fixes commit 94d8fee Author: arjxn.py <arjxn.py@gmail.com> Date: Sun Jun 18 12:16:38 2023 +0530 Remove pybind11 if exist in pybamm-requires commit 31571da Author: arjxn.py <arjxn.py@gmail.com> Date: Sun Jun 18 11:53:15 2023 +0530 Use `session.install` instead of `session.run` commit 1aa8b8a Author: Arjun <arjunverma.oc@gmail.com> Date: Sun Jun 18 11:45:01 2023 +0530 Apply suggestions from code review Co-authored-by: Saransh Chopra <saransh0701@gmail.com> commit 961a6be Merge: b5372be abc53f5 Author: arjxn.py <arjxn.py@gmail.com> Date: Sun Jun 18 03:01:08 2023 +0530 Merge branch 'develop' into Migrate-to-tox4 commit b5372be Author: arjxn.py <arjxn.py@gmail.com> Date: Sun Jun 18 02:36:54 2023 +0530 Squash previous 69 commits commit f78a989 Merge: a9e3e5f 7e681e2 Author: Jason Siegel <siegeljb@gmail.com> Date: Wed May 24 13:03:16 2023 -0400 Merge branch 'pybamm-team:develop' into split_SOC_and_Vlimits commit a9e3e5f Merge: 449cf33 4f4a66a Author: Jason Siegel <siegeljb@gmail.com> Date: Wed May 24 09:34:08 2023 -0400 Merge branch 'pybamm-team:develop' into split_SOC_and_Vlimits commit 449cf33 Author: Jason Siegel <siegeljb@umich.edu> Date: Mon May 22 22:44:38 2023 -0400 update parameter_values.py to use upper and lowwer voltage limits if not defined, need to add a warning if we skip loading from the file and use a the limits commit 16385d7 Author: Jason Siegel <siegeljb@umich.edu> Date: Mon May 22 21:10:02 2023 -0400 fixing unit tests in progress still work to do to pass PBX commit bd43160 Merge: d5dbf95 d90a56c Author: js1tr3 <siegeljb@gmail.com> Date: Mon May 22 13:27:44 2023 -0400 Merge branch 'pybamm-team:develop' into split_SOC_and_Vlimits commit d5dbf95 Merge: c465f98 124efe5 Author: Jason Siegel <siegeljb@umich.edu> Date: Thu Apr 27 16:42:37 2023 -0400 Merge remote-tracking branch 'upstream/develop' into split_SOC_and_Vlimits commit c465f98 Merge: b0bd481 4f03df4 Author: js1tr3 <siegeljb@gmail.com> Date: Thu Feb 23 10:10:01 2023 -0500 Merge branch 'develop' into split_SOC_and_Vlimits commit b0bd481 Merge: 612a727 219d9b4 Author: js1tr3 <siegeljb@gmail.com> Date: Thu Feb 23 07:30:11 2023 -0500 Merge branch 'split_SOC_and_Vlimits' of https://github.com/js1tr3/PyBaMM into split_SOC_and_Vlimits commit 612a727 Author: Jason Siegel <siegeljb@umich.edu> Date: Mon Dec 19 21:47:32 2022 -0500 fix the unit test for new split soc and voltage simulation limits commit 95ab3fe Author: Jason Siegel <siegeljb@umich.edu> Date: Fri Dec 16 19:29:57 2022 -0500 update tutorial 4 commit 219d9b4 Merge: b59362f 279d05b Author: js1tr3 <siegeljb@gmail.com> Date: Thu Feb 23 06:59:19 2023 -0500 Merge branch 'split_SOC_and_Vlimits' of https://github.com/js1tr3/PyBaMM into split_SOC_and_Vlimits commit b59362f Author: js1tr3 <siegeljb@gmail.com> Date: Thu Feb 23 06:48:56 2023 -0500 fix long text lines for format fix long lines for pep8 format commit 6a766d2 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Dec 23 22:27:10 2022 +0000 style: pre-commit fixes commit 01e5fdb Author: js1tr3 <siegeljb@gmail.com> Date: Fri Dec 23 17:22:55 2022 -0500 updated examples to use new variables for stoich window calculation added new voltage limits to ESOH example and half cell commit ac150f5 Author: siegeljb <siegeljb@umich.edu> Date: Tue Dec 20 21:06:01 2022 -0500 updates to unit test,,, commit e326c6b Author: Jason Siegel <siegeljb@umich.edu> Date: Mon Dec 19 21:47:32 2022 -0500 fix the unit test for new split soc and voltage simulation limits commit 5e078b4 Author: siegeljb <siegeljb@umich.edu> Date: Fri Dec 16 22:47:38 2022 -0500 add ocp at 100% SOC to li ion parameters file commit 953937b Author: Jason Siegel <siegeljb@umich.edu> Date: Fri Dec 16 19:29:57 2022 -0500 update tutorial 4 commit 82be625 Author: Jason Siegel <siegeljb@umich.edu> Date: Thu Dec 15 23:26:55 2022 -0500 split voltage maximum and minumum from voltages used to calculate stoich windows for 0 and 100% SOC commit 3c26d86 Author: Jason Siegel <siegeljb@umich.edu> Date: Thu Dec 15 23:07:05 2022 -0500 split voltage maximum and minumum from voltages used to calculate stoich windows for 0 and 100% SOC commit 279d05b Author: js1tr3 <siegeljb@gmail.com> Date: Thu Feb 23 06:48:56 2023 -0500 fix long text lines for format fix long lines for pep8 format commit 5003fcf Merge: bb74c4e 0c120de Author: Ferran Brosa Planella <Ferran.Brosa-Planella@warwick.ac.uk> Date: Tue Jan 31 14:22:19 2023 +0000 Merge pull request pybamm-team#2635 from pybamm-team/develop Make release v23.1 commit bb74c4e Merge: 08db559 e090ada Author: Ferran Brosa Planella <Ferran.Brosa-Planella@warwick.ac.uk> Date: Sat Dec 31 17:58:24 2022 +0100 Merge pull request pybamm-team#2586 from pybamm-team/develop Make release v22.12 commit 07003d4 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri Dec 23 22:27:10 2022 +0000 style: pre-commit fixes commit a00603e Author: js1tr3 <siegeljb@gmail.com> Date: Fri Dec 23 17:22:55 2022 -0500 updated examples to use new variables for stoich window calculation added new voltage limits to ESOH example and half cell commit 1086fa4 Author: siegeljb <siegeljb@umich.edu> Date: Tue Dec 20 21:06:01 2022 -0500 updates to unit test,,, commit ca90221 Author: Jason Siegel <siegeljb@umich.edu> Date: Mon Dec 19 21:47:32 2022 -0500 fix the unit test for new split soc and voltage simulation limits commit 7b943d1 Author: siegeljb <siegeljb@umich.edu> Date: Fri Dec 16 22:47:38 2022 -0500 add ocp at 100% SOC to li ion parameters file commit d516507 Author: Jason Siegel <siegeljb@umich.edu> Date: Fri Dec 16 19:29:57 2022 -0500 update tutorial 4 commit 465c45f Author: Jason Siegel <siegeljb@umich.edu> Date: Thu Dec 15 23:26:55 2022 -0500 split voltage maximum and minumum from voltages used to calculate stoich windows for 0 and 100% SOC commit d3bdea9 Author: Jason Siegel <siegeljb@umich.edu> Date: Thu Dec 15 23:07:05 2022 -0500 split voltage maximum and minumum from voltages used to calculate stoich windows for 0 and 100% SOC
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ pre-commit run
(see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all
$ python run-tests.py --doctest
You can run unit and doctests together at once, using
$ python run-tests.py --quick
.Further checks: