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 developer requirements to setup.py #712

Merged
merged 11 commits into from May 12, 2023
Merged

Conversation

peanutfun
Copy link
Member

@peanutfun peanutfun commented May 3, 2023

Changes proposed in this PR:

  • Remove env_developer.yml and move the developer requirement specifications into extras in setup.py.

    setup.py now defines three extras, doc for the documentation, test for the test tools, and a convenience extra dev which combines the two.

  • Remove pip specs from env_climada.yml. Pip will now only be called once and install all remaining packages when Climada is installed.

  • Switch from nbsphinx to myst_nb for parsing Jupyter Notebooks for the documentation.

    We previously specified both packages as requirements but only used nbsphinx. However, nbsphinx requires pandoc which cannot be installed via pip. To remove the pandoc requirement from the conda environment, I switched to myst-nb, which works the same way, can be installed via pip, and seems to support more features. From what I can see, this did not change anything in the display of the notebooks (reviewer please double check that!)

  • Update .readthedocs.yml to install the docs requirements from setup.py. Alternatively, the env_doc.yml could be updated

This PR fixes #696

PR Author Checklist

PR Reviewer Checklist

* Remove `requirements/env_developer.yml`.
* Add extras for docs and test to `setup.py`.
* Fix requirements:
  - Remove descartes, it was not used.
  - Remove pandoc in favor of myst_nb.
@peanutfun peanutfun changed the base branch from main to develop May 3, 2023 14:28
@peanutfun peanutfun marked this pull request as ready for review May 4, 2023 09:00
@peanutfun peanutfun linked an issue May 4, 2023 that may be closed by this pull request
@peanutfun
Copy link
Member Author

I just noticed that math does not render properly, trying to fix that now...

@peanutfun
Copy link
Member Author

peanutfun commented May 4, 2023

Math is rendering now. However, the "Contents" links in the tutorials broke (for the online documentation only). This is because myst uses a different anchor slug structure than nbsphinx. I think we can leave it as is.

https://github.com/CLIMADA-project/climada_python/pull/712/files#diff-cfbe05e73a29504cae64178b403c69f5c532ccf3abeb4e14c66b96e137ca642c shows an example how to fix them

@peanutfun peanutfun requested a review from chahank May 11, 2023 15:29
@chahank
Copy link
Member

chahank commented May 11, 2023

The instructions look clear. @emanuel-schmid : could you please review for functionality?

@emanuel-schmid
Copy link
Collaborator

Everything could be so nice - but, alas!, Windows! 🙄

climada_python>python -m pip install -e '.\[dev]'
ERROR: '.\[dev]' is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file)

Let's see what google can tell me about this one...

@emanuel-schmid
Copy link
Collaborator

emanuel-schmid commented May 12, 2023

Actually quite easy:

pip install -e "./[dev]" 

@emanuel-schmid emanuel-schmid merged commit 1e9ee71 into develop May 12, 2023
4 checks passed
@emanuel-schmid emanuel-schmid deleted the remove-env-developer branch May 12, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move developer requirements into setup.py
3 participants