Skip to content

Commit

Permalink
fix(version tag): add pyproject.toml to use setuptools_scm with relea…
Browse files Browse the repository at this point in the history
…se-branch-semver scheme
  • Loading branch information
sqr00t committed Oct 6, 2023
2 parents ad825e1 + d400b35 commit 31e58f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build-system]
requires = [
"setuptools>=64",
"setuptools_scm>=8",
]

[tool.setuptools_scm]
version_scheme = "release-branch-semver"
19 changes: 4 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,12 @@
from pathlib import Path
from setuptools import find_packages
from setuptools import setup
import setuptools_scm

import os
import subprocess
import platform
import platform

tag_cmd = "git describe --tags --abbrev=0"
tag_cmd = tag_cmd if platform.system() == "Windows" else f"echo $({tag_cmd})"

try:
tag_version = (
subprocess.check_output(tag_cmd, shell=False).decode("ascii").replace("\n", "")
)
except:
#an error occurred, potentially an issue with git cli
tag_version = "v1.0.0"

print(f"Tag version: {tag_version}")

def read_lines(path):
"""Read lines of `path`."""
Expand All @@ -38,14 +27,14 @@ def read_lines(path):
packages=find_packages(
exclude=["docs", "ojd_daps_skills/analysis", "ojd_daps_skills/app"]
),
classifiers=['Development Status :: 5 - Production/Stable'],
classifiers=["Development Status :: 5 - Production/Stable"],
package_data={
# If any package contains *.yaml files, include them:
"": [
"*.yaml",
],
},
version=tag_version,
version=setuptools_scm.get_version(),
description="Extract skills from job ads and maps them onto a skills taxonomy of your choice.",
url="https://github.com/nestauk/ojd_daps_skills",
project_urls={
Expand Down

0 comments on commit 31e58f7

Please sign in to comment.