Skip to content
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

Always use versioneer command classes in setup.py #948

Merged
merged 2 commits into from
Jul 25, 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
7 changes: 2 additions & 5 deletions conda/recipes/dask-cuda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{% set data = load_setup_py_data() %}

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set py_version=environ.get('CONDA_PY', 36) %}
package:
name: dask-cuda
Expand All @@ -15,10 +14,8 @@ source:
git_url: ../../..

build:
number: {{ git_revision_count }}
string: py{{ py_version }}_{{ git_revision_count }}
script_env:
- VERSION_SUFFIX
number: {{ GIT_DESCRIBE_NUMBER }}
string: py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}

requirements:
host:
Expand Down
27 changes: 21 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,31 @@
long_description = f.read()

if "GIT_DESCRIBE_TAG" in os.environ:
# Disgusting hack. For pypi uploads we cannot use the
# versioneer-provided version for non-release builds, since they
# strictly follow PEP440
# https://peps.python.org/pep-0440/#local-version-identifiers
# which disallows local version identifiers (as produced by
# versioneer) in public index servers.
# We still want to use versioneer infrastructure, so patch
# in our pypi-compatible version to the output of
# versioneer.get_versions.

orig_get_versions = versioneer.get_versions
version = os.environ["GIT_DESCRIBE_TAG"] + os.environ.get("VERSION_SUFFIX", "")
cmdclass = {}
else:
version = versioneer.get_version()
cmdclass = versioneer.get_cmdclass()

def get_versions():
data = orig_get_versions()
data["version"] = version
return data

versioneer.get_versions = get_versions


setup(
name="dask-cuda",
version=version,
cmdclass=cmdclass,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Utilities for Dask and CUDA interactions",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down