mirror of https://github.com/Nonannet/copapy.git
Merge pull request #21 from Nonannet/dev
added automatic git based versioning
This commit is contained in:
commit
0bc637bdac
|
|
@ -41,6 +41,8 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -87,6 +89,8 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -140,6 +144,8 @@ jobs:
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: stencil-object-files
|
name: stencil-object-files
|
||||||
|
|
@ -169,6 +175,8 @@ jobs:
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: stencil-object-files
|
name: stencil-object-files
|
||||||
|
|
@ -198,6 +206,8 @@ jobs:
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: stencil-object-files
|
name: stencil-object-files
|
||||||
|
|
@ -232,6 +242,8 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -279,6 +291,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
fetch-tags: true
|
||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
tools/get_tag.sh
|
tools/get_tag.sh
|
||||||
|
|
@ -325,6 +338,8 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "copapy"
|
name = "copapy"
|
||||||
version = "0.0.3"
|
dynamic = ["version"]
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Nicolas Kruse", email="nicolas.kruse@nonan.net" },
|
{ name="Nicolas Kruse", email="nicolas.kruse@nonan.net" },
|
||||||
]
|
]
|
||||||
|
|
@ -20,7 +20,7 @@ Homepage = "https://github.com/nonannet/copapy"
|
||||||
Issues = "https://github.com/nonannet/copapy/issues"
|
Issues = "https://github.com/nonannet/copapy/issues"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools>=61.0", "wheel"]
|
requires = ["setuptools>=61.0", "setuptools-scm>=8", "wheel"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
|
|
@ -29,6 +29,17 @@ where = ["src"]
|
||||||
[tool.setuptools.package-data]
|
[tool.setuptools.package-data]
|
||||||
copapy = ["obj/*.o", "py.typed"]
|
copapy = ["obj/*.o", "py.typed"]
|
||||||
|
|
||||||
|
[tool.setuptools_scm]
|
||||||
|
version_scheme = "post-release"
|
||||||
|
local_scheme = "node-and-date"
|
||||||
|
tag_regex = "^v(?P<version>\\d+\\.\\d+\\.\\d+(?:-beta)?)$"
|
||||||
|
fallback_version = "0.0.0"
|
||||||
|
write_to = "src/copapy/_version.py"
|
||||||
|
write_to_template = '''
|
||||||
|
# generated by setuptools_scm - do not edit
|
||||||
|
__version__ = "{version}"
|
||||||
|
'''
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
"ruff",
|
"ruff",
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,11 @@ from ._tensors import tensor, zeros, ones, arange, eye, identity, diagonal
|
||||||
from ._math import sqrt, abs, sign, sin, cos, tan, asin, acos, atan, atan2, log, exp, pow, get_42, clamp, min, max, relu
|
from ._math import sqrt, abs, sign, sin, cos, tan, asin, acos, atan, atan2, log, exp, pow, get_42, clamp, min, max, relu
|
||||||
from ._autograd import grad
|
from ._autograd import grad
|
||||||
from ._tensors import tensor as matrix
|
from ._tensors import tensor as matrix
|
||||||
|
from ._version import __version__
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
"__version__",
|
||||||
"Target",
|
"Target",
|
||||||
"NumLike",
|
"NumLike",
|
||||||
"value",
|
"value",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# generated by setuptools_scm - do not edit
|
||||||
|
__version__ = "0.0.0"
|
||||||
|
|
@ -10,18 +10,6 @@ if [[ "${GITHUB_REF:-}" == refs/tags/* ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Otherwise, extract version from pyproject.toml
|
# Detected version from Git
|
||||||
if [[ -f pyproject.toml ]]; then
|
TAG_NAME=$(git describe --tags --abbrev=0)
|
||||||
VERSION=$(grep -E '^version\s*=' pyproject.toml \
|
echo "version=$TAG_NAME" >> "${GITHUB_OUTPUT:-/dev/stdout}"
|
||||||
| sed -E 's/version\s*=\s*"([^"]+)"/\1/' \
|
|
||||||
| tr -d '\r\n')
|
|
||||||
if [[ -z "$VERSION" ]]; then
|
|
||||||
echo "! Could not find version in pyproject.toml" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Detected version from pyproject.toml: v$VERSION-beta"
|
|
||||||
echo "version=v$VERSION-beta" >> "${GITHUB_OUTPUT:-/dev/stdout}"
|
|
||||||
else
|
|
||||||
echo "! pyproject.toml not found" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue