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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

# Install GMT and other required dependencies from conda-forge
- name: Install dependencies
run: conda env update --file environment.yml
run: conda install gmt=6.1.1 make poetry

# Show installed pkg information for postmortem diagnostic
- name: List installed packages
Expand All @@ -105,9 +105,7 @@ jobs:

# Install the package that we want to test
- name: Install the package
run: |
python setup.py sdist --formats=zip
pip install dist/*
run: poetry install --extras docs

# Run the tests
- name: Test with pytest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dist/
*.egg-info/
.eggs/
MANIFEST
poetry.lock

# Unit test / coverage reports
.cache
Expand Down
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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.

description = "A Python interface for the Generic Mapping Tools"
authors = ["The PyGMT Developers"]
license = "BSD License"

[tool.poetry.dependencies]
myst-parser = {version = "*", optional = true}
netCDF4 = "*"
numpy = "*"
packaging = "*"
pandas = "*"
python = "^3.7"
sphinx = {version = "*", optional = true}
sphinx-copybutton = {version = "*", optional = true}
sphinx-gallery = {version = "*", optional = true}
sphinx_rtd_theme = {version = "0.4.3", optional = true}
xarray = "*"

[tool.poetry.dev-dependencies]
black = "*"
blackdoc = "*"
codecov = "*"
coverage = {extras = ["toml"], version = "*"}
docformatter = "*"
flake8 = "*"
ipython = "*"
isort = ">=5"
jupyter = "*"
make = "*"
matplotlib = "*"
pylint = "*"
pytest-cov = "*"
pytest-mpl = "*"
pytest = ">=6.0"

[tool.poetry.extras]
docs = ["myst-parser", "sphinx", "sphinx-copybutton", "sphinx-gallery", "sphinx_rtd_theme"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.coverage.run]
omit = ["*/tests/*", "*pygmt/__init__.py"]

Expand Down