Skip to content

Commit

Permalink
remove complicated and costly versioning mechanisms :D
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlehoff committed Nov 24, 2023
1 parent e47ec46 commit 1e07a81
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 105 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# extra files created to hold the versioning information
validphys2/src/validphys/_version.py

# extra files created by cmake
libnnpdf/nnprofile.yaml
libnnpdf/scripts/nnpdf.pc
Expand Down
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,4 @@ if(VP_DEV)
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install --no-deps -e ${PROJECT_SOURCE_DIR})")
else(VP_DEV)
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install --no-deps --ignore-installed ${PROJECT_SOURCE_DIR})")
if(BURN_TAG)
install(CODE "set(LIBRARY \"validphys\")")
install(SCRIPT ${PROJECT_SOURCE_DIR}/version.cmake)
install(CODE "set(LIBRARY \"n3fit\")")
install(SCRIPT ${PROJECT_SOURCE_DIR}/version.cmake)
endif(BURN_TAG)
endif(VP_DEV)
1 change: 1 addition & 0 deletions n3fit/src/evolven3fit_new/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from validphys._version import __version__, __version_tuple__
3 changes: 1 addition & 2 deletions n3fit/src/n3fit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from n3fit.version import build_version
__version__ = build_version
from validphys._version import __version__, __version_tuple__
41 changes: 0 additions & 41 deletions n3fit/src/n3fit/version.py

This file was deleted.

29 changes: 19 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry]
name = "nnpdf"
version = "4.0.8"
version = "0.0.0"
description = "An open-source machine learning framework for global analyses of parton distributions."
readme = "README.md"
authors = [
Expand Down Expand Up @@ -101,14 +101,23 @@ docs = ["recommonmark", "sphinxcontrib", "sphinx-rtd-theme", "sphinx"]
qed = ["fiatlux"]
nolha = ["pdfflow", "lhapdf-management"]

# [tool.poetry-dynamic-versioning]
# enable = true
# vcs = "git"
# style = "semver"
# dirty = true
# [tool.poetry-dynamic-versioning.substitution]
# files = ["validphys2/src/validphys/__init__.py", "n3fit/src/n3fit/__init__.py"]
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
metadata = true
dirty = true
semver = true
pattern = "default-unprefixed" # we don't use v in the tags

[tool.poetry-dynamic-versioning.substitution]
files = ["validphys2/src/validphys/_version.py"]

[tool.poetry-dynamic-versioning.files."validphys2/src/validphys/_version.py"]
persistent-substitution = true
initial-content = """
__version__ = "0.0.0"
__version_tuple__ = (0, 0, 0)
"""

[tool.black]
line-length = 100
Expand Down
5 changes: 1 addition & 4 deletions validphys2/src/validphys/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# We don't want to import stuff here that could slow down the import times
from validphys.version import build_version

__version__ = build_version
from ._version import __version__, __version_tuple__
39 changes: 0 additions & 39 deletions validphys2/src/validphys/version.py

This file was deleted.

3 changes: 0 additions & 3 deletions version.cmake

This file was deleted.

0 comments on commit 1e07a81

Please sign in to comment.