Skip to content

Migrate from setup.cfg to pyproject.toml #48

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

Merged
merged 8 commits into from
Jun 28, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
run: |
python -m twine check dist/*
pwd
if [ -f dist/cupy-xarray-0.0.0.tar.gz ]; then
if [ -f dist/cupy_xarray-0.0.0.tar.gz ]; then
echo "❌ INVALID VERSION NUMBER"
exit 1
else
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
include versioneer.py
include cupy_xarray/_version.py
include requirements.txt
include LICENSE
include README.md
include pyproject.toml
prune cupy_xarray/tests*


recursive-exclude * __pycache__
recursive-exclude * *.py[co]
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
[build-system]
requires = ["setuptools", "versioneer[toml]"]
build-backend = "setuptools.build_meta"

[project]
name = "cupy-xarray"
description = "Interface for using cupy in xarray, providing convenience accessors."
authors = [{name = "cupy-xarray developers"}]
license = {text = "Apache License"}
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
dynamic = ["version"]
dependencies = [
"cupy",
"xarray>=2024.02.0",
]

[project.optional-dependencies]
test = [
"dask",
"pytest",
]

[tool.ruff]
line-length = 100 # E501 (line-too-long)
exclude = [
Expand All @@ -17,3 +44,11 @@ select = [
"SIM", # flake8-simplify
"W", # pycodestyle warnings
]

[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "cupy_xarray/_version.py"
versionfile_build = "cupy_xarray/_version.py"
tag_prefix = ""
parentdir_prefix = ""
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements_test.txt

This file was deleted.

7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

26 changes: 5 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,8 @@

import versioneer

with open("README.md", encoding="utf-8") as fh:
long_description = fh.read()
with open("requirements.txt") as fh:
requirements = [line.strip() for line in fh]

setuptools.setup(
name="cupy-xarray",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="cupy-xarray developers",
description="Interface for using cupy in xarray, providing convenience accessors.",
long_description=long_description,
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
python_requires=">=3.7",
install_requires=requirements,
)
if __name__ == "__main__":
setuptools.setup(
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
Comment on lines +7 to +8
Copy link
Member Author

@weiji14 weiji14 Jun 25, 2024

Choose a reason for hiding this comment

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

Unfortunately, we still need a setup.py file with these versioneer.get_version() and versioneer.get_cmdclass() calls, otherwise the built sdist and wheel will have an invalid 0.0.0 version 😞 See python-versioneer/python-versioneer#381.

If we really want to remove the setup.py file, we can discuss about replacing versioneer with setuptools-scm, and do it in a follow-up PR.

)
Loading