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

Add optional dependencies to pyproject.toml #2069

Merged
merged 7 commits into from
Aug 25, 2022
Merged

Conversation

seisman
Copy link
Member

@seisman seisman commented Aug 20, 2022

Description of proposed changes

As suggested in #1848 (comment), this PR adds optional-dependencies to pyproject.toml so that people can run pip install pygmt[all] to install pygmt with optional dependencies included.

To test it locally, you can check out this branch, change into the root directory, and run

pip install .

and

pip install .[all]

you should see that pip install .[all] also check if geopandas is installed while pip install . doesn't.

Address #1848 (comment).

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@seisman seisman added the maintenance Boring but important stuff for the core devs label Aug 21, 2022
@seisman seisman added this to the 0.8.0 milestone Aug 21, 2022
@seisman
Copy link
Member Author

seisman commented Aug 22, 2022

I'm not sure if we should update the pip install pygmt command to pip install pygmt[all]
in the installation instructions (https://www.pygmt.org/dev/install.html).

Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

I'm not sure if we should update the pip install pygmt command to pip install pygmt[all] in the installation instructions (https://www.pygmt.org/dev/install.html).

Wouldn't recommend replacing it with pip install pygmt[all], but I think we can mention the pip install pygmt[all] command in https://www.pygmt.org/v0.7.0/install.html#using-pip and indicate that this will install optional dependencies like geopandas.

pyproject.toml Outdated
@@ -32,6 +32,11 @@ dependencies = [
]
dynamic = ["version"]

[project.optional-dependencies]
all = [
"geopandas"
Copy link
Member

Choose a reason for hiding this comment

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

Should we add ipython as well as mentioned in https://www.pygmt.org/v0.7.0/install.html#dependencies?

Suggested change
"geopandas"
"geopandas",
"ipython"

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, because we also try to import IPython in our codes.

@seisman seisman force-pushed the optional-dependencies branch from 4cc4429 to 4483e01 Compare August 22, 2022 14:48
@seisman seisman marked this pull request as ready for review August 22, 2022 14:50
doc/install.rst Outdated Show resolved Hide resolved
doc/install.rst Outdated Show resolved Hide resolved
@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Aug 24, 2022
@seisman seisman merged commit 0907868 into main Aug 25, 2022
@seisman seisman deleted the optional-dependencies branch August 25, 2022 01:27
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Aug 25, 2022
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants