Skip to content

Commit bab5d10

Browse files
Merge pull request #968 from IntelPython/update-versioneer
Updated versioneer to 0.28
2 parents 977b896 + ede08ee commit bab5d10

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

dpctl/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# that just contains the computed version number.
77

88
# This file is released into the public domain.
9-
# Generated by versioneer-0.26
9+
# Generated by versioneer-0.28
1010
# https://github.com/python-versioneer/python-versioneer
1111

1212
"""Git implementation of _version.py."""

versioneer.py

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Version: 0.26
2+
# Version: 0.28
33

44
"""The Versioneer - like a rocketeer, but for versions.
55
@@ -30,21 +30,27 @@
3030
### Vendored mode
3131
3232
* `pip install versioneer` to somewhere in your $PATH
33-
* add a `[tool.versioneer]` section to your `pyproject.toml or a
33+
* A [conda-forge recipe](https://github.com/conda-forge/versioneer-feedstock) is
34+
available, so you can also use `conda install -c conda-forge versioneer`
35+
* add a `[tool.versioneer]` section to your `pyproject.toml` or a
3436
`[versioneer]` section to your `setup.cfg` (see [Install](INSTALL.md))
37+
* Note that you will need to add `tomli; python_version < "3.11"` to your
38+
build-time dependencies if you use `pyproject.toml`
3539
* run `versioneer install --vendor` in your source tree, commit the results
3640
* verify version information with `python setup.py version`
3741
3842
### Build-time dependency mode
3943
4044
* `pip install versioneer` to somewhere in your $PATH
41-
* add a `[tool.versioneer]` section to your `pyproject.toml or a
45+
* A [conda-forge recipe](https://github.com/conda-forge/versioneer-feedstock) is
46+
available, so you can also use `conda install -c conda-forge versioneer`
47+
* add a `[tool.versioneer]` section to your `pyproject.toml` or a
4248
`[versioneer]` section to your `setup.cfg` (see [Install](INSTALL.md))
43-
* add `versioneer` to the `requires` key of the `build-system` table in
44-
`pyproject.toml`:
49+
* add `versioneer` (with `[toml]` extra, if configuring in `pyproject.toml`)
50+
to the `requires` key of the `build-system` table in `pyproject.toml`:
4551
```toml
4652
[build-system]
47-
requires = ["setuptools", "versioneer"]
53+
requires = ["setuptools", "versioneer[toml]"]
4854
build-backend = "setuptools.build_meta"
4955
```
5056
* run `versioneer install --no-vendor` in your source tree, commit the results
@@ -286,9 +292,8 @@
286292
287293
To make Versioneer easier to embed, all its code is dedicated to the public
288294
domain. The `_version.py` that it creates is also in the public domain.
289-
Specifically, both are released under the Creative Commons "Public Domain
290-
Dedication" license (CC0-1.0), as described in
291-
https://creativecommons.org/publicdomain/zero/1.0/ .
295+
Specifically, both are released under the "Unlicense", as described in
296+
https://unlicense.org/.
292297
293298
[pypi-image]: https://img.shields.io/pypi/v/versioneer.svg
294299
[pypi-url]: https://pypi.python.org/pypi/versioneer/
@@ -313,11 +318,15 @@
313318
from pathlib import Path
314319
from typing import Callable, Dict
315320
import functools
316-
try:
317-
import tomli
318-
have_tomli = True
319-
except ImportError:
320-
have_tomli = False
321+
322+
have_tomllib = True
323+
if sys.version_info >= (3, 11):
324+
import tomllib
325+
else:
326+
try:
327+
import tomli as tomllib
328+
except ImportError:
329+
have_tomllib = False
321330

322331

323332
class VersioneerConfig:
@@ -373,12 +382,12 @@ def get_config_from_root(root):
373382
pyproject_toml = root / "pyproject.toml"
374383
setup_cfg = root / "setup.cfg"
375384
section = None
376-
if pyproject_toml.exists() and have_tomli:
385+
if pyproject_toml.exists() and have_tomllib:
377386
try:
378387
with open(pyproject_toml, 'rb') as fobj:
379-
pp = tomli.load(fobj)
388+
pp = tomllib.load(fobj)
380389
section = pp['tool']['versioneer']
381-
except (tomli.TOMLDecodeError, KeyError):
390+
except (tomllib.TOMLDecodeError, KeyError):
382391
pass
383392
if not section:
384393
parser = configparser.ConfigParser()
@@ -470,7 +479,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
470479
# that just contains the computed version number.
471480
472481
# This file is released into the public domain.
473-
# Generated by versioneer-0.26
482+
# Generated by versioneer-0.28
474483
# https://github.com/python-versioneer/python-versioneer
475484
476485
"""Git implementation of _version.py."""
@@ -1363,7 +1372,7 @@ def do_vcs_install(versionfile_source, ipy):
13631372
if "VERSIONEER_PEP518" not in globals():
13641373
try:
13651374
my_path = __file__
1366-
if my_path.endswith(".pyc") or my_path.endswith(".pyo"):
1375+
if my_path.endswith((".pyc", ".pyo")):
13671376
my_path = os.path.splitext(my_path)[0] + ".py"
13681377
versioneer_file = os.path.relpath(my_path)
13691378
except NameError:
@@ -1411,7 +1420,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
14111420

14121421

14131422
SHORT_VERSION_PY = """
1414-
# This file was generated by 'versioneer.py' (0.26) from
1423+
# This file was generated by 'versioneer.py' (0.28) from
14151424
# revision-control system data, or from the parent directory name of an
14161425
# unpacked source archive. Distribution tarballs contain a pre-generated copy
14171426
# of this file.
@@ -1900,6 +1909,8 @@ def run(self):
19001909
return
19011910
# now locate _version.py in the new build/ directory and replace
19021911
# it with an updated value
1912+
if not cfg.versionfile_build:
1913+
return
19031914
target_versionfile = os.path.join(self.build_lib,
19041915
cfg.versionfile_build)
19051916
if not os.path.exists(target_versionfile):
@@ -1973,7 +1984,7 @@ def run(self):
19731984

19741985
# sdist farms its file list building out to egg_info
19751986
if 'egg_info' in cmds:
1976-
_sdist = cmds['egg_info']
1987+
_egg_info = cmds['egg_info']
19771988
else:
19781989
from setuptools.command.egg_info import egg_info as _egg_info
19791990

0 commit comments

Comments
 (0)