From 6ada42406aaa11f7d3d30eceb139bb36a7f80ff8 Mon Sep 17 00:00:00 2001 From: Serge Koudoro Date: Mon, 30 Jan 2023 14:43:32 -0500 Subject: [PATCH] use hatchling and not setuptools --- .coveragerc | 1 + .git_archival.txt | 4 ++ .gitignore | 2 + .pep8speaks.yml | 12 ++++++ MANIFEST.in | 17 -------- pyproject.toml | 100 ++++++++++++++++++++++------------------------ test_platform.sh | 12 ------ 7 files changed, 67 insertions(+), 81 deletions(-) create mode 100644 .git_archival.txt create mode 100644 .pep8speaks.yml delete mode 100644 MANIFEST.in delete mode 100755 test_platform.sh diff --git a/.coveragerc b/.coveragerc index d4e3d458f..176cfa09a 100644 --- a/.coveragerc +++ b/.coveragerc @@ -5,5 +5,6 @@ include = */fury/* omit = */setup.py */_version.py + */tests/* [report] show_missing = True diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 000000000..66bef37c5 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:match=[0-9]*)$ +ref-names: $Format:%D$ \ No newline at end of file diff --git a/.gitignore b/.gitignore index dcaef0a1f..c9a5121ec 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,5 @@ target/ tmp/ temp/ +_version.py + diff --git a/.pep8speaks.yml b/.pep8speaks.yml new file mode 100644 index 000000000..99e56d2f1 --- /dev/null +++ b/.pep8speaks.yml @@ -0,0 +1,12 @@ +scanner: + diff_only: True # Only show errors caused by the patch + linter: flake8 + +message: # Customize the comment made by the bot + opened: # Messages when a new PR is submitted + header: "Hello @{name}, thank you for submitting the Pull Request!" + footer: "To test for issues locally, `pip install flake8` and then run `flake8 fury`." + updated: # Messages when new commits are added to the PR + header: "Hello @{name}, Thank you for updating!" + footer: "To test for issues locally, `pip install flake8` and then run `flake8 fury`." + no_errors: "Cheers! There are no style issues detected in this Pull Request. :beers: " \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 09833c997..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,17 +0,0 @@ -include AUTHORS.rst -include CONTRIBUTING.rst -include LICENSE -include README.md - -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] - -recursive-include docs *.rst conf.py Makefile make.bat - -include fury/_version.py - -# If including data files in the package, add them like: -# include path/to/data_file -include fury/data/files/* -include fury/shaders/* -include fury/stream/server/www/* \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 812a3165b..98c335e82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,13 @@ [build-system] -requires = ["setuptools>=65.4", "setuptools_scm[toml]>=7.1", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" [project] name = "fury" description = "FURY - Free Unified Rendering in pYthon. A free and open-source software library for Scientific Visualization and 3D animations" -#long_description = "file: README.md" -#long_description_content_type = "text/markdown; charset=UTF-8" -readme = "file: README.md" -requires-python = ">=3.7" -license.file="file: LICENSE" +readme = "README.md" +requires-python = ">=3.8" +license.file="LICENSE" keywords = ["Scientific Visualization", "shaders", "animation", "simulation", "Physically based rendering", "3D", "3D rendering", "networks", "physics engine", "physics", "simulation", "visualization"] @@ -36,9 +34,10 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Scientific/Engineering", ] @@ -48,75 +47,72 @@ dependencies = [ "vtk>=9.1.0", "pillow>=5.4.1", "packaging >=17.0", - "setuptools", ] dynamic = ["version"] -[tool.setuptools] -#packages = ["fury"] -zip-safe = false -platforms = ["OS Independent", "Windows", "Mac OS-X", "Linux"] -include-package-data = true - -[tool.setuptools.packages.find] -#where = ["fury"] # list of folders that contain the packages (["."] by default) -exclude = ["docs", "tests"] - -#[tool.setuptools.package_data] -# When adding files here, remember to update MANIFEST.in as well, -# or else they will not be included in the distribution on PyPI! -# 'path/to/data_file', -#fury = ["fury/data/files/*", "fury/shaders/*"] - -[tool.setuptools_scm] -write_to = "fury/_version.py" +[project.urls] +Documentation = "https://fury.gl" +Source = "https://github.com/fury-gl/fury" +Tracker = "https://github.com/fury-gl/fury/issues" [project.optional-dependencies] +all = ["fury[plot, dev, doc, medical, style, test]"] plot = ["matplotlib>=1.5.3", ] - medical = ["dipy", "nibabel"] - dev = [ "gitpython", "twine", ] - doc = [ "matplotlib >= 1.5.3", "numpydoc", - "sphinx >=0.3,<3", + "sphinx >=6.1.2", "texext", + "tomli; python_version < \"3.11\"", ] - -style = [ - "flake8", - ] +style = ["flake8", "blue", "isort", "pre-commit"] test = [ "coverage", "pytest !=5.3.4", "pytest-cov", "pytest-doctestplus", ] -all = [ - "fury[plot]", - "fury[dev]", - "fury[doc]", - "fury[medical]", - "fury[style]", - "fury[test]", - ] - -[project.urls] -Documentation = "https://fury.gl" -Source = "https://github.com/fury-gl/fury" -Tracker = "https://github.com/fury-gl/fury/issues" - -[tool.black] -line-length = 90 -fast = true +[tool.hatch.build.targets.sdist] +exclude = [".git_archival.txt"] + +[tool.hatch.build.targets.wheel] +packages = ["fury",] +exclude = [] + +[tool.hatch.version] +source = "vcs" +raw-options = { version_scheme = "release-branch-semver" } + +[tool.hatch.build.hooks.vcs] +version-file = "fury/_version.py" + +[tool.blue] +line_length = 99 +target-version = ["py38"] +force-exclude = """ +( + _version.py +) +""" + +[tool.isort] +profile = "black" +line_length = 99 +extend_skip = ["_version.py", "externals"] + +[tool.mypy] +python_version = "3.11" +exclude = [ + "/tests", +] [tool.coverage.run] branch = true diff --git a/test_platform.sh b/test_platform.sh deleted file mode 100755 index c29095729..000000000 --- a/test_platform.sh +++ /dev/null @@ -1,12 +0,0 @@ -error_code=0 -for file in `find . -name 'test_*.py' -print`; -do - if coverage run -m -p pytest -svv $file; then - error_code=1 - fi -done -coverage combine . -coverage report -m - -exit $error_code -