Skip to content

Commit

Permalink
Adds back setup file.
Browse files Browse the repository at this point in the history
  • Loading branch information
arokem committed Dec 6, 2024
1 parent dc59fa2 commit 103c0bf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
dynamic = ["version"]

[tool.setuptools_scm]
write_to = "afqinsight/_version.py"

Expand Down
32 changes: 32 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import os.path as op
import string

from setuptools import setup
from setuptools_scm import get_version


def local_version(version):
"""Patch in a version that can be uploaded to test PyPI."""
scm_version = get_version()
if "dev" in scm_version:
gh_in_int = []
for char in version.node:
if char.isdigit():
gh_in_int.append(str(char))
else:
gh_in_int.append(str(string.ascii_letters.find(char)))
return "".join(gh_in_int)
else:
return ""


opts = {
"use_scm_version": {
"write_to": op.join("afqinsight", "_version.py"),
"local_scheme": local_version,
}
}


if __name__ == "__main__":
setup(**opts)

0 comments on commit 103c0bf

Please sign in to comment.