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

Finish pyproject.toml migration #382

Merged
merged 46 commits into from
Nov 8, 2022
Merged

Conversation

jakirkham
Copy link
Member

@jakirkham jakirkham commented Nov 3, 2022

Moves the bulk of metadata, requirements, etc. to pyproject.toml. As there are still extensions that need to be built, we still rely on setuptools to do that. Also skip running cythonize on extensions as setuptools already does this for us. Additionally try using build_ext from Cython to perform the build. This way we can even do parallel builds when passing -j <#> to build_ext. Finally switch to latest (as opposed to legacy) setuptools, since the legacy case should no longer be needed.

Closes #364

TODO:

  • Unit tests and/or doctests in docstrings
  • Tests pass locally
  • Docstrings and API docs for any new/modified user-facing classes and functions
  • Changes documented in docs/release.rst
  • Docs build locally
  • GitHub Actions CI passes
  • Test coverage to 100% (Codecov passes)

@jakirkham jakirkham mentioned this pull request Nov 3, 2022
@jakirkham
Copy link
Member Author

@Saransh-cpp @DimitriPapadopoulos, could both of you please take a look? 🙂

@lgtm-com
Copy link

lgtm-com bot commented Nov 3, 2022

This pull request introduces 2 alerts when merging ac5ccf0 into 552f437 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Module is imported with 'import' and 'import from'

@jakirkham

This comment was marked as resolved.

pyproject.toml Outdated Show resolved Hide resolved
@jakirkham jakirkham force-pushed the update_bld branch 5 times, most recently from f5c469b to 1625526 Compare November 3, 2022 06:42
@jakirkham
Copy link
Member Author

Note RTD needs fixes outside of this. Handling in PR ( #383 ).

@lgtm-com
Copy link

lgtm-com bot commented Nov 3, 2022

This pull request introduces 2 alerts when merging 1625526 into 552f437 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Module is imported with 'import' and 'import from'

@jakirkham jakirkham changed the title Move more over to pyproject.toml Finish pyproject.toml migration Nov 3, 2022
@jakirkham jakirkham mentioned this pull request Nov 3, 2022
7 tasks
Windows defaults to `int32` so won't display those `dtype`s. Whereas
UNIX defaults to `int64` and so won't display those `dtype`s. This
creates mismatches between the representations in docstrings between the
two platforms. For simplicity just use `int16`, which both platforms
will represent the same. This should ensure consistency with doctests.
This was used to configure compilers on Windows in the past.
Particularly it was used to configure Python 2.7 Windows builds. However
as of Python 3.5 and UCRT on Windows, this is unnecessary. Further
Python 2.7 was improved by a one off Windows Python compiler installer.
In any event this can safely be dropped. It is not used in this repo and
shouldn't be needed outside of it.
@jakirkham
Copy link
Member Author

Please let me know if there's anything else needed here

Copy link
Contributor

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

Thanks, @jakirkham and @DimitriPapadopoulos! No more comments from my side 🚀

@jakirkham jakirkham requested review from DimitriPapadopoulos and joshmoore and removed request for DimitriPapadopoulos November 7, 2022 21:02
Copy link
Member

@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

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

Two minor thoughts, likely follow-ons. 👍

"version",
]
classifiers = [
"Development Status :: 4 - Beta",
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps outwith this PR but is "Beta" still appropriate?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. Filed as issue ( #394 )

@@ -99,16 +99,11 @@ the repository, you can do something like the following::
$ mkdir -p ~/pyenv/numcodecs-dev
$ virtualenv --no-site-packages --python=/usr/bin/python3.9 ~/pyenv/numcodecs-dev
$ source ~/pyenv/numcodecs-dev/bin/activate
$ pip install -r requirements_dev.txt
$ python setup.py build_ext --inplace
$ pip install -e .[docs,test,msgpack,zfpy]
Copy link
Member

Choose a reason for hiding this comment

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

Would it be "normal" to also have an "all" alias to cover these?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah agree that would be useful, but unless we write our own (which doesn't seem very DRY friendly) or handle this in setup.py. Am not aware of any existing option. Also please see this upstream issue ( pypa/pip#4340 ).

Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos left a comment

Choose a reason for hiding this comment

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

I think I have reached my limits here. I don't have other useful suggestions. It looks good to me within these limits.

This should always be available as `cython` is a build requirement. So
simplify to just use Cython and skip `setuptools` here.
@jakirkham
Copy link
Member Author

Thanks all! 🙏 Going to go ahead and merge this in. Happy to follow up on anything else after

@jakirkham jakirkham merged commit 7bc303a into zarr-developers:main Nov 8, 2022
@jakirkham jakirkham deleted the update_bld branch November 8, 2022 09:24
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 to pyproject.toml
5 participants