From 5287c7b2546fc8848f539bb5ee66bb8d91d8496f Mon Sep 17 00:00:00 2001 From: keewis Date: Sun, 21 Feb 2021 21:27:05 +0100 Subject: [PATCH] add pyproject.toml (#4897) * add a initial pyproject.toml file * reformat the toml file * use setuptools_scm_git_archive to support git archives * add entries for whats-new.rst * remove setup_requires * require setuptools >= 42 since that's required for using pyproject.toml * add a fallback version --- .git_archival.txt | 1 + .gitattributes | 2 ++ doc/whats-new.rst | 5 +++++ pyproject.toml | 11 +++++++++++ setup.cfg | 4 ---- 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 .git_archival.txt create mode 100644 pyproject.toml diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 00000000000..95cb3eea4e3 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1 @@ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes index a52f4ca283a..7a79ddd6b0b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ # reduce the number of merge conflicts doc/whats-new.rst merge=union +# allow installing from git archives +.git_archival.txt export-subst diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 05066f883bf..8efb985a175 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -34,6 +34,9 @@ Breaking changes (:issue:`4688`, :pull:`4720`) By `Justus Magin `_. +- use ``pyproject.toml`` instead of the ``setup_requires`` option for + ``setuptools`` (:pull:`4897`). + By `Justus Magin `_. - As a result of :pull:`4684` the default units encoding for datetime-like values (``np.datetime64[ns]`` or ``cftime.datetime``) will now always be set such that ``int64`` values can be used. In the past, no units @@ -86,6 +89,8 @@ New Features - :py:meth:`DataArray.swap_dims` & :py:meth:`Dataset.swap_dims` now accept dims in the form of kwargs as well as a dict, like most similar methods. By `Maximilian Roos `_. +- Allow installing from git archives (:pull:`4897`). + By `Justus Magin `_. - :py:func:`open_dataset` and :py:func:`open_mfdataset` now accept ``fsspec`` URLs (including globs for the latter) for ``engine="zarr"``, and so allow reading from diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..f1f1a2ac8a6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,11 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", + "setuptools_scm[toml]>=3.4", + "setuptools_scm_git_archive", +] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +fallback_version = "999" diff --git a/setup.cfg b/setup.cfg index 231865d7788..5037cb9c584 100644 --- a/setup.cfg +++ b/setup.cfg @@ -77,10 +77,6 @@ install_requires = numpy >= 1.15 pandas >= 0.25 setuptools >= 40.4 # For pkg_resources -setup_requires = - setuptools >= 40.4 - setuptools_scm - [options.extras_require] io =