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

Move sphinx-gallery as an optional dependency for testing #2439

Merged
merged 3 commits into from
May 2, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Mar 18, 2023

Description of proposed changes

Sphinx-Gallery is a required dependency for building the PyGMT documentation. Since we write our own PyGMT scraper and we have a test for it (https://github.com/GenericMappingTools/pygmt/blob/main/pygmt/tests/test_sphinx_gallery.py), it's also required for the PyGMT tests, but it should be an optional dependency for testing.

What this PR does:

  1. In Doctests workflow: remove sphinx-gallery because it's not needed
  2. In Tests workflow: move sphinx-gallery as an optional dependency, thus sphinx-gallery is not installed in the Python 3.9 job but is installed in the Python 3.11 workflow.
  3. In Tests Legacy workflow, remove sphinx-gallery because I think we don't care whether PyGMTScraper works with Python 3.9 but I keep it in the Tests Dev workflow

Since sphinx-gallery is optional when running the tests, we need to use try-except clause to check if sphinx-gallery is installed (see the changes in pygmt/sphinx_gallery.py).

This PR reverts some changes in #1525.

The "GMT Dev Tests" workflow failures are tracked in #2511.

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.
  • Use underscores (not hyphens) in names of Python files and directories.

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 this to the 0.10.0 milestone Mar 19, 2023
@seisman seisman changed the title Make sphinx-gallery be an optional dependency in testing Move sphinx-gallery to optional dependencies in testing Mar 29, 2023
@seisman seisman marked this pull request as ready for review April 28, 2023 07:09
@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Apr 28, 2023
@seisman seisman changed the title Move sphinx-gallery to optional dependencies in testing Move sphinx-gallery as an optional dependency for testing Apr 28, 2023
@seisman seisman requested a review from weiji14 April 28, 2023 07:27
@seisman seisman added the needs review This PR has higher priority and needs review. label Apr 28, 2023
@seisman
Copy link
Member Author

seisman commented Apr 28, 2023

The "GMT Dev Tests" workflow failures are tracked in #2511.

Actually, the CI fails to install the GMT dev version from conda-forge on Windows. Perhaps we need to build a new dev version on conda-forge?

    The following packages are incompatible
    ├─ gmt   is installable with the potential options
    │  ├─ gmt 6.4.0.dev5+b5e996c would require
    │  │  ├─ gdal >=3.5.0,<3.6.0a0  with the potential options
    │  │  │  ├─ gdal [3.3.3|3.4.0|...|3.6.4] would require
    │  │  │  │  └─ python >=3.10,<3.11.0a0 , which can be installed;
    │  │  │  ├─ gdal [2.4.1|2.4.2|...|3.5.2] would require
    │  │  │  │  └─ python >=3.7,<3.8.0a0 , which can be installed;
    │  │  │  ├─ gdal [2.4.3|2.4.4|...|3.6.4] would require
    │  │  │  │  └─ python >=3.8,<3.9.0a0 , which can be installed;
    │  │  │  ├─ gdal [3.1.3|3.1.4|...|3.6.4] would require
    │  │  │  │  └─ python >=3.9,<3.10.0a0 , which can be installed;
    │  │  │  ├─ gdal [3.5.2|3.5.3|...|3.6.3] would require
    │  │  │  │  └─ libgdal [3.5.2 h263b2b1_7|3.5.2 h283e77c_7|...|3.6.3 hfcbebb6_6], which requires
    │  │  │  │     ├─ icu >=70.1,<71.0a0 , which can be installed;
    │  │  │  │     └─ poppler [>=22.10.0,<22.11.0a0 |>=22.11.0,<22.12.0a0 |...|>=23.4.0,<23.5.0a0 ], which requires
    │  │  │  │        └─ cairo >=1.16.0,<2.0a0  but there are no viable options
    │  │  │  │           ├─ cairo 1.16.0 would require
    │  │  │  │           │  └─ icu >=72.1,<73.0a0 , which conflicts with any installable versions previously reported;
    │  │  │  │           ├─ cairo 1.16.0 conflicts with any installable versions previously reported;
    │  │  │  │           └─ cairo 1.16.0 would require
    │  │  │  │              └─ vc 9.* , which does not exist (perhaps a missing channel);
    │  │  │  └─ gdal 3.5.3 would require
    │  │  │     └─ libgdal [3.5.3 h057a47d_21|3.5.3 h5ac7d24_25|...|3.5.3 hfcbebb6_24], which requires
    │  │  │        └─ geos >=3.11.2,<3.11.3.0a0 , which can be installed;
    │  │  └─ geos >=3.10.2,<3.10.3.0a0 , which conflicts with any installable versions previously reported;
    │  ├─ gmt [6.5.0.dev2+b0c2f6d|6.5.0.dev3+609ccc1] would require
    │  │  ├─ gdal [>=3.6.0,<3.7.0a0 |>=3.6.2,<3.7.0a0 ] with the potential options
    │  │  │  ├─ gdal [3.3.3|3.4.0|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.3|2.4.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.1.3|3.1.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.5.2|3.5.3|...|3.6.3], which cannot be installed (as previously explained);
    │  │  │  └─ gdal [3.6.3|3.6.4] would require
    │  │  │     └─ libgdal [3.6.3 h69cf491_8|3.6.4 h69cf491_0], which requires
    │  │  │        ├─ geos >=3.11.2,<3.11.3.0a0 , which can be installed;
    │  │  │        └─ libcurl >=8.0.1,<9.0a0 , which can be installed;
    │  │  └─ geos >=3.11.1,<3.11.2.0a0 , which conflicts with any installable versions previously reported;
    │  ├─ gmt 6.5.0.dev3+609ccc1 would require
    │  │  ├─ curl >=7.88.1,<8.0a0  but there are no viable options
    │  │  │  ├─ curl 7.88.1 would require
    │  │  │  │  └─ libcurl 7.88.1 h68f0423_0, which conflicts with any installable versions previously reported;
    │  │  │  └─ curl 7.88.1 would require
    │  │  │     └─ libcurl 7.88.1 h68f0423_1, which conflicts with any installable versions previously reported;
    │  │  └─ gdal >=3.6.3,<3.7.0a0  with the potential options
    │  │     ├─ gdal [3.3.3|3.4.0|...|3.6.4], which can be installed (as previously explained);
    │  │     ├─ gdal [2.4.3|2.4.4|...|3.6.4], which can be installed (as previously explained);
    │  │     ├─ gdal [3.1.3|3.1.4|...|3.6.4], which can be installed (as previously explained);
    │  │     ├─ gdal [3.5.2|3.5.3|...|3.6.3], which cannot be installed (as previously explained);
    │  │     └─ gdal [3.6.3|3.6.4], which can be installed (as previously explained);
    │  ├─ gmt 6.5.0.dev2+b0c2f6d would require
    │  │  ├─ gdal   with the potential options
    │  │  │  ├─ gdal [3.3.3|3.4.0|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.1|2.4.2|...|3.5.2], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.3|2.4.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.1.3|3.1.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.5.2|3.5.3|...|3.6.3], which cannot be installed (as previously explained);
    │  │  │  ├─ gdal 3.5.3, which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.1|2.4.2] would require
    │  │  │  │  └─ libgdal [2.4.1 h742b11c_10|2.4.1 ha766355_9|...|2.4.2 hdca2004_5], which requires
    │  │  │  │     └─ icu >=58.2,<59.0a0  but there are no viable options
    │  │  │  │        ├─ icu 58.2 would require
    │  │  │  │        │  └─ vc 14 , which does not exist (perhaps a missing channel);
    │  │  │  │        └─ icu 58.2 would require
    │  │  │  │           └─ vc 9 , which does not exist (perhaps a missing channel);
    │  │  │  ├─ gdal [2.4.1|2.4.2|...|3.3.2] would require
    │  │  │  │  └─ python >=3.6,<3.7.0a0 , which can be installed;
    │  │  │  └─ gdal [3.6.3|3.6.4], which can be installed (as previously explained);
    │  │  └─ geos >=3.11.1,<3.11.2.0a0 , which conflicts with any installable versions previously reported;
    │  ├─ gmt 6.5.0.dev2+b0c2f6d would require
    │  │  ├─ gdal   with the potential options
    │  │  │  ├─ gdal [3.3.3|3.4.0|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.1|2.4.2|...|3.5.2], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.3|2.4.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.1.3|3.1.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.5.2|3.5.3|...|3.6.3], which cannot be installed (as previously explained);
    │  │  │  ├─ gdal 3.5.3, which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.1|2.4.2], which cannot be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.1|2.4.2|...|3.3.2], which can be installed (as previously explained);
    │  │  │  └─ gdal [3.6.3|3.6.4], which can be installed (as previously explained);
    │  │  └─ geos >=3.11.0,<3.11.1.0a0 , which conflicts with any installable versions previously reported;
    │  ├─ gmt [6.3.0.dev4+2f64c67|6.3.0.dev5+52c6629|...|6.4.0.dev5+b5e996c] would require
    │  │  └─ gdal [>=3.3.3,<3.4.0a0 |>=3.4.0,<3.5.0a0 |>=3.4.1,<3.5.0a0 |>=3.4.2,<3.5.0a0 |>=3.4.3,<3.5.0a0 ], which can be installed (as previously explained);
    │  ├─ gmt [6.2.0.dev10+767de58|6.2.0.dev11+257b86c|...|6.2.0rc1] would require
    │  │  └─ gdal [>=3.1.4,<3.2.0a0 |>=3.2.1,<3.3.0a0 |>=3.2.2,<3.3.0a0 ], which can be installed (as previously explained);
    │  ├─ gmt [6.2.0rc1|6.2.0rc2|...|6.3.0.dev4+2f64c67] would require
    │  │  └─ gdal [>=3.3.0,<3.4.0a0 |>=3.3.1,<3.4.0a0 |>=3.3.2,<3.4.0a0 ], which can be installed (as previously explained);
    │  ├─ gmt [6.0.0rc1|6.0.0rc2|6.0.0rc3] would require
    │  │  └─ gdal [>=2.4.1,<2.5.0a0 |>=2.4.2,<2.5.0a0 ] with the potential options
    │  │     ├─ gdal [2.4.1|2.4.2|...|3.5.2], which can be installed (as previously explained);
    │  │     ├─ gdal [2.4.3|2.4.4|...|3.6.4], which can be installed (as previously explained);
    │  │     ├─ gdal [2.4.1|2.4.2], which cannot be installed (as previously explained);
    │  │     └─ gdal [2.4.1|2.4.2|...|3.3.2], which can be installed (as previously explained);
    │  ├─ gmt [6.0.0rc4|6.0.0rc5|...|6.2.0.dev4+92c5676] would require
    │  │  └─ gdal [>=3.0.1,<3.1.0a0 |>=3.0.4,<3.1.0a0 ], which can be installed (as previously explained);
    │  ├─ gmt [6.4.0.dev5+b5e996c|6.5.0.dev1+fa6828c] would require
    │  │  ├─ gdal [>=3.5.0,<3.6.0a0 |>=3.5.1,<3.6.0a0 |>=3.5.2,<3.6.0a0 ] with the potential options
    │  │  │  ├─ gdal [3.3.3|3.4.0|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.1|2.4.2|...|3.5.2], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.3|2.4.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.1.3|3.1.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.5.2|3.5.3|...|3.6.3], which cannot be installed (as previously explained);
    │  │  │  └─ gdal 3.5.3, which can be installed (as previously explained);
    │  │  └─ geos >=3.11.0,<3.11.1.0a0 , which conflicts with any installable versions previously reported;
    │  ├─ gmt 6.4.0.dev5+b5e996c would require
    │  │  ├─ gdal >=3.5.0,<3.6.0a0  with the potential options
    │  │  │  ├─ gdal [3.3.3|3.4.0|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.1|2.4.2|...|3.5.2], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.3|2.4.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.1.3|3.1.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.5.2|3.5.3|...|3.6.3], which cannot be installed (as previously explained);
    │  │  │  └─ gdal 3.5.3, which can be installed (as previously explained);
    │  │  └─ geos >=3.10.3,<3.10.4.0a0 , which conflicts with any installable versions previously reported;
    │  ├─ gmt 6.5.0.dev2+b0c2f6d would require
    │  │  ├─ gdal >=3.5.3,<3.6.0a0  with the potential options
    │  │  │  ├─ gdal [3.3.3|3.4.0|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [2.4.3|2.4.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.1.3|3.1.4|...|3.6.4], which can be installed (as previously explained);
    │  │  │  ├─ gdal [3.5.2|3.5.3|...|3.6.3], which cannot be installed (as previously explained);
    │  │  │  └─ gdal 3.5.3, which can be installed (as previously explained);
    │  │  └─ geos >=3.11.0,<3.11.1.0a0 , which conflicts with any installable versions previously reported;
    │  └─ gmt [5.4.5|6.0.0|...|6.4.0] conflicts with any installable versions previously reported;
    └─ pin-1   is uninstallable because it requires
       └─ python 3.11.* , which conflicts with any installable versions previously reported.
critical libmamba Could not solve for environment specs
Error: Process completed with exit code 1.

@seisman
Copy link
Member Author

seisman commented May 1, 2023

Ping @weiji14 for review

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.

Actually, the CI fails to install the GMT dev version from conda-forge on Windows. Perhaps we need to build a new dev version on conda-forge?

New GMT 6.5.0 dev version PR at conda-forge/gmt-feedstock#248.

@seisman seisman merged commit 2a05f9e into main May 2, 2023
14 of 15 checks passed
@seisman seisman deleted the sphinx-gallery-optional branch May 2, 2023 01:44
@seisman seisman removed the needs review This PR has higher priority and needs review. label May 2, 2023
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 skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants