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

Consolidate requirements and repository configuration #789

Merged
merged 29 commits into from
Apr 19, 2021

Conversation

rocco8773
Copy link
Member

The primary goal here is to consolidate how we define package requirements (build, install, tests, docs, etc.). Right now package requirements/dependencies are declared manually in many of the repository configuration files. After the refactor, dependencies should only be defined in the requirements/*.txt files and the setup.cfg file, with appropriate comments to direct developers. Any configuration file that needs dependencies should refer to the locations just mentioned.

This will most likely include housekeeping of the repository configuration files.

@rocco8773 rocco8773 added refactoring ♻️ Improving an implementation without adding new functionality optimization Related to optimizing performance, such as with Cython or Numba labels Apr 22, 2020
@rocco8773 rocco8773 self-assigned this Apr 22, 2020
@codecov
Copy link

codecov bot commented Apr 22, 2020

Codecov Report

Merging #789 (d2465d8) into master (4a71ade) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #789      +/-   ##
==========================================
- Coverage   96.91%   96.91%   -0.01%     
==========================================
  Files          70       70              
  Lines        6931     6930       -1     
==========================================
- Hits         6717     6716       -1     
  Misses        214      214              
Impacted Files Coverage Δ
plasmapy/diagnostics/langmuir.py 93.75% <ø> (ø)
plasmapy/optional_deps.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a71ade...d2465d8. Read the comment docs.

Copy link
Member

@namurphy namurphy left a comment

Choose a reason for hiding this comment

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

Looking good so far!

requirements/docs.txt Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
requirements/install.txt Outdated Show resolved Hide resolved
.readthedocs.yml Show resolved Hide resolved
plasmapy/diagnostics/langmuir.py Show resolved Hide resolved
setup.cfg Outdated
Comment on lines 73 to 77
developer =
# install everything for developers
%(docs)s
%(extras)s
%(tests)s
Copy link
Member

Choose a reason for hiding this comment

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

wow, does that actually work? Sick! I guess the good folks over at sunpy (e.g. Stuart) didn't know about it, see:

PlasmaPy/setup.py

Lines 12 to 13 in 91db401

# Dev is everything
extras["dev"] = list(chain(*extras.values()))

we'll have to dump that, probably, and update the docs th

Copy link
Member

Choose a reason for hiding this comment

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

darn touchpad, that dev is now developer.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I noticed this too and had no idea we could do this. I like it!

requirements.txt Outdated
@@ -0,0 +1,8 @@
# all dependencies required to build, run, test, and doucment plasmapy
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# all dependencies required to build, run, test, and doucment plasmapy
# all dependencies required to build, run, test, and document PlasmaPy

requirements/install.txt Outdated Show resolved Hide resolved
setup.cfg Outdated
tests =
pytest >= 5.1
theory =
# for plasmapy.theory
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# for plasmapy.theory
# for plasmapy.formulary

setup.cfg Outdated Show resolved Hide resolved
@namurphy
Copy link
Member

Astropy now requires Numpy version >= 1.16.0, so we probably ought to update that requirement in this PR to be consistent with them.

astropy >= 3.1
colorama >= 0.3
matplotlib >= 3.2
numpy >= 1.14
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
numpy >= 1.14
numpy >= 1.16

Copy link
Member

Choose a reason for hiding this comment

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

Does it, now? That's likely a sign of units issues going away!

@namurphy
Copy link
Member

I just realized that requirements information will be needed for the CodeMeta file, so it's likely there will be one more place that will need to be updated... This could be done just prior to every release, though.

@namurphy namurphy mentioned this pull request May 1, 2020
5 tasks
@rocco8773 rocco8773 requested a review from StanczakDominik May 19, 2020 18:32
@StanczakDominik
Copy link
Member

I've been thinking that this would be worthwhile to prioritise. Would you mind if I picked this up from here?

@StanczakDominik
Copy link
Member

@namurphy @rocco8773 a question. f150758 claims that the .zenodo.json file is outdated and removes it. Can I ask for some context on that?

I would gladly remove it from the release guidelines 😜

@github-actions github-actions bot added the plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage label Mar 30, 2021
@StanczakDominik StanczakDominik requested review from StanczakDominik and removed request for StanczakDominik March 30, 2021 11:05
@StanczakDominik
Copy link
Member

One funny thing I realized with with the %(extras)s aprroach to extras in setup.cfg: it concatenates the requirements. So we get h5py a bunch of times. But then pip turns them into a set along the way, I think, so it should be fine.

@StanczakDominik
Copy link
Member

StanczakDominik commented Mar 30, 2021

@rocco8773 I'm not quite sure what you were referring to with the BaPSFlib setup. I cleaned it up as much as I could for now, though.

@StanczakDominik StanczakDominik marked this pull request as ready for review March 30, 2021 11:40
@StanczakDominik StanczakDominik requested a review from a team March 30, 2021 11:42
@StanczakDominik
Copy link
Member

StanczakDominik commented Mar 30, 2021

Two issues that I'd rather leave for the next PR to touch these:

https://github.com/rocco8773/PlasmaPy/blob/7769ee263e7c70353fac9fa3496b1ff2befba90f/setup.cfg#L32-L34

This would probably simplify our conda packaging process a little.

https://github.com/rocco8773/PlasmaPy/blob/7769ee263e7c70353fac9fa3496b1ff2befba90f/tox.ini#L53-L90

I have not yet been able to simplify these, and would definitely like to. I suspect that there might be some way to specify "take the minimum of the range for these extras", maybe a pip install flag... but I don't know yet.

I will turn these into issues once this gets merged.

@rocco8773
Copy link
Member Author

@rocco8773 I'm not quite sure what you were referring to with the BaPSFlib setup. I cleaned it up as much as I could for now, though.

Look how I structured and commented the requirements between the ./requirements/ directory, setup.cfg, and pyproject.toml in BaPSF/bapsflib#47. Basically I'm wanted link back comments so if we make a change to setup.cfg we know to also change X, and visa-versa.

@StanczakDominik
Copy link
Member

Look how I structured and commented the requirements between the ./requirements/ directory, setup.cfg, and pyproject.toml in BaPSF/bapsflib#47. Basically I'm wanted link back comments so if we make a change to setup.cfg we know to also change X, and visa-versa.

The appropriate comments were already there, just with config.cfg rather than setup.cfg! Anyway, looks like that's done.

Copy link
Member

@StanczakDominik StanczakDominik left a comment

Choose a reason for hiding this comment

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

This has stalled out long enough, and doesn't break stuff; in the interest of getting it through before we have to fix more merge conflicts, let's get it in!

@StanczakDominik StanczakDominik dismissed namurphy’s stale review April 19, 2021 18:02

suggestions got addressed!

@StanczakDominik StanczakDominik enabled auto-merge (squash) April 19, 2021 18:02
@StanczakDominik StanczakDominik merged commit ccca766 into PlasmaPy:master Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Related to optimizing performance, such as with Cython or Numba plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage refactoring ♻️ Improving an implementation without adding new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants