Skip to content

Updated versioneer to 0.28 #968

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 1 commit into from
Nov 4, 2022
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 dpctl/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# that just contains the computed version number.

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

"""Git implementation of _version.py."""
Expand Down
53 changes: 32 additions & 21 deletions versioneer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Version: 0.26
# Version: 0.28

"""The Versioneer - like a rocketeer, but for versions.

Expand Down Expand Up @@ -30,21 +30,27 @@
### Vendored mode

* `pip install versioneer` to somewhere in your $PATH
* add a `[tool.versioneer]` section to your `pyproject.toml or a
* A [conda-forge recipe](https://github.com/conda-forge/versioneer-feedstock) is
available, so you can also use `conda install -c conda-forge versioneer`
* add a `[tool.versioneer]` section to your `pyproject.toml` or a
`[versioneer]` section to your `setup.cfg` (see [Install](INSTALL.md))
* Note that you will need to add `tomli; python_version < "3.11"` to your
build-time dependencies if you use `pyproject.toml`
* run `versioneer install --vendor` in your source tree, commit the results
* verify version information with `python setup.py version`

### Build-time dependency mode

* `pip install versioneer` to somewhere in your $PATH
* add a `[tool.versioneer]` section to your `pyproject.toml or a
* A [conda-forge recipe](https://github.com/conda-forge/versioneer-feedstock) is
available, so you can also use `conda install -c conda-forge versioneer`
* add a `[tool.versioneer]` section to your `pyproject.toml` or a
`[versioneer]` section to your `setup.cfg` (see [Install](INSTALL.md))
* add `versioneer` to the `requires` key of the `build-system` table in
`pyproject.toml`:
* add `versioneer` (with `[toml]` extra, if configuring in `pyproject.toml`)
to the `requires` key of the `build-system` table in `pyproject.toml`:
```toml
[build-system]
requires = ["setuptools", "versioneer"]
requires = ["setuptools", "versioneer[toml]"]
build-backend = "setuptools.build_meta"
```
* run `versioneer install --no-vendor` in your source tree, commit the results
Expand Down Expand Up @@ -286,9 +292,8 @@

To make Versioneer easier to embed, all its code is dedicated to the public
domain. The `_version.py` that it creates is also in the public domain.
Specifically, both are released under the Creative Commons "Public Domain
Dedication" license (CC0-1.0), as described in
https://creativecommons.org/publicdomain/zero/1.0/ .
Specifically, both are released under the "Unlicense", as described in
https://unlicense.org/.

[pypi-image]: https://img.shields.io/pypi/v/versioneer.svg
[pypi-url]: https://pypi.python.org/pypi/versioneer/
Expand All @@ -313,11 +318,15 @@
from pathlib import Path
from typing import Callable, Dict
import functools
try:
import tomli
have_tomli = True
except ImportError:
have_tomli = False

have_tomllib = True
if sys.version_info >= (3, 11):
import tomllib
else:
try:
import tomli as tomllib
except ImportError:
have_tomllib = False


class VersioneerConfig:
Expand Down Expand Up @@ -373,12 +382,12 @@ def get_config_from_root(root):
pyproject_toml = root / "pyproject.toml"
setup_cfg = root / "setup.cfg"
section = None
if pyproject_toml.exists() and have_tomli:
if pyproject_toml.exists() and have_tomllib:
try:
with open(pyproject_toml, 'rb') as fobj:
pp = tomli.load(fobj)
pp = tomllib.load(fobj)
section = pp['tool']['versioneer']
except (tomli.TOMLDecodeError, KeyError):
except (tomllib.TOMLDecodeError, KeyError):
pass
if not section:
parser = configparser.ConfigParser()
Expand Down Expand Up @@ -470,7 +479,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
# that just contains the computed version number.

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

"""Git implementation of _version.py."""
Expand Down Expand Up @@ -1363,7 +1372,7 @@ def do_vcs_install(versionfile_source, ipy):
if "VERSIONEER_PEP518" not in globals():
try:
my_path = __file__
if my_path.endswith(".pyc") or my_path.endswith(".pyo"):
if my_path.endswith((".pyc", ".pyo")):
my_path = os.path.splitext(my_path)[0] + ".py"
versioneer_file = os.path.relpath(my_path)
except NameError:
Expand Down Expand Up @@ -1411,7 +1420,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):


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

# sdist farms its file list building out to egg_info
if 'egg_info' in cmds:
_sdist = cmds['egg_info']
_egg_info = cmds['egg_info']
else:
from setuptools.command.egg_info import egg_info as _egg_info

Expand Down