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

WIP: Setup poetry in pyproject.toml #1055

Closed
wants to merge 2 commits into from
Closed

WIP: Setup poetry in pyproject.toml #1055

wants to merge 2 commits into from

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Mar 14, 2021

Description of proposed changes

Initializing poetry to see if it can speed up the install step in our Continuous Integration.

conda works in serial and can be a bit slow, while poetry can install things in parallel. The idea here is to use conda only for non-Python packages (i.e. GMT and make), and poetry for Python dependencies (e.g. numpy, pandas, etc).

Notes:

  • Use poetry install --no-dev to get only the minimum required dependencies for PyGMT
  • Use poetry install to get both minimum and development dependencies (e.g. pytest, black, codecov, etc)
  • Use poetry install --no-dev --extras docs to install minimum and dependencies for building docs (e.g. sphinx, etc)
  • Use poetry install --extras docs to get all of the above

Addresses #584, may help with #690

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 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

weiji14 added 2 commits March 14, 2021 17:01
Translating the Python specific dependencies inside
the conda environment.yml file into poetry.
Project metadata and required dependencies
are copied from setup.py. There are also optional
dependencies for building sphinx documentation
and development specific dependencies for testing.
Only installing GMT and make via conda, plus
poetry just to make things easy. The PyGMT
package and all the necessary Python
dependencies are installed using poetry.
@weiji14 weiji14 added the maintenance Boring but important stuff for the core devs label Mar 14, 2021
@weiji14 weiji14 added this to the 0.4.0 milestone Mar 14, 2021
@weiji14 weiji14 marked this pull request as draft March 14, 2021 04:21
@seisman
Copy link
Member

seisman commented Mar 14, 2021

Just in case you don't notice it: poetry doesn't work well with setuptools_scm, so the version is v0.3.1, not v0.3.1.dev100+xxxxx.

@@ -1,3 +1,47 @@
[tool.poetry]
name = "pygmt"
version = "0.3.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

Just in case you don't notice it: poetry doesn't work well with setuptools_scm, so the version is v0.3.1, not v0.3.1.dev100+xxxxx.

Yeah I realize that this hardcoding is bad. There's https://github.com/mtkennerly/poetry-dynamic-versioning but doesn't look like a very official solution.

To be honest, this PR isn't intended to replace setup.py just yet. Just wanted to see if mixing conda and poetry might shave a few minutes off the CI test time.

@weiji14
Copy link
Member Author

weiji14 commented Mar 15, 2021

We've got #1033 so this PR probably isn't needed anymore, but I'll keep this open for a while as it'll be nice to cherry-pick the poetry stuff in pyproject.toml from this PR into somewhere else to solve #690 or something else :)

@seisman seisman removed this from the 0.4.0 milestone Mar 19, 2021
@weiji14
Copy link
Member Author

weiji14 commented Jun 10, 2021

Closing this PR. May reopen it in the future if there's any interest in using poetry 🙂

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