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

Update to modern Python project setup (setup.py to pyproject.toml) #992

Merged
merged 8 commits into from
May 31, 2024

Conversation

konstntokas
Copy link
Contributor

@konstntokas konstntokas commented May 30, 2024

This PR updates the setup of xcube using pyproject.toml instead of setup.py. I tested new setup by installing it locally and by uploading it to TestPyPI and installing it with pip install -i https://test.pypi.org/simple/ xcube-core==1.6.0.dev2

Checklist:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/source/*
  • Changes documented in CHANGES.md
  • GitHub CI passes
  • AppVeyor CI passes
  • Test coverage remains or increases (target 100%)

build-backend = "setuptools.build_meta"

[project]
name = "xcube-core"
Copy link
Contributor Author

@konstntokas konstntokas May 30, 2024

Choose a reason for hiding this comment

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

In pyproject.toml, the name field cannot be dynamic (like e.g. "version").
I set the name to "xcube-core" since this will be name shown on PyPI.
The import runs as usual with import xcube. Some disccusion is given here

Will this name field in pyproject.toml have any implication with conda releases?

Copy link
Member

Choose a reason for hiding this comment

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

@konstntokas The name shouldn't have any effect on conda-forge: conda-forge's own package name (or names) is defined explicitly in meta.yaml, and our feedstock configuration fetches the xcube source straight from GitHub so it doesn't care about the PyPI name.

@konstntokas konstntokas marked this pull request as ready for review May 30, 2024 11:18
@konstntokas konstntokas force-pushed the konstntokas-xxx-update_to_pyproject_toml branch from 6af11c3 to be78bf0 Compare May 30, 2024 11:52
@konstntokas konstntokas requested a review from pont-us May 30, 2024 12:35
Copy link
Member

@pont-us pont-us left a comment

Choose a reason for hiding this comment

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

One minor change request, otherwise fine :)

build-backend = "setuptools.build_meta"

[project]
name = "xcube-core"
Copy link
Member

Choose a reason for hiding this comment

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

@konstntokas The name shouldn't have any effect on conda-forge: conda-forge's own package name (or names) is defined explicitly in meta.yaml, and our feedstock configuration fetches the xcube source straight from GitHub so it doesn't care about the PyPI name.

appveyor.yml Outdated Show resolved Hide resolved
Co-authored-by: Pontus Lurcock <pontus.lurcock@brockmann-consult.de>
Copy link
Member

@forman forman left a comment

Choose a reason for hiding this comment

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

Great!

@forman forman merged commit faf41e5 into main May 31, 2024
3 checks passed
@konstntokas konstntokas deleted the konstntokas-xxx-update_to_pyproject_toml branch May 31, 2024 12:45
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.

3 participants