Skip to content

Commit

Permalink
Fix updating of formulaic.__version__ during build.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwardrop committed Sep 10, 2022
1 parent f1b671f commit 691ce3f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
formulaic/_version.py

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
11 changes: 10 additions & 1 deletion formulaic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
from ._version import __author__, __author_email__, __version__
from .formula import Formula, FormulaSpec
from .materializers import FactorValues
from .model_matrix import ModelMatrix, ModelMatrices
from .model_spec import ModelSpec, ModelSpecs
from .sugar import model_matrix

try:
from ._version import __version__, __version_tuple__
except ImportError: # pragma: no cover
__version__ = version = "unknown"
__version_tuple__ = version_tuple = ("unknown",)

__author__ = "Matthew Wardrop"
__author_email__ = "[email protected]"

__all__ = [
"__author__",
"__author_email__",
"__version__",
"__version_tuple__",
"Formula",
"FormulaSpec",
"ModelMatrix",
Expand Down
5 changes: 0 additions & 5 deletions formulaic/_version.py

This file was deleted.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ calculus = ["sympy<1.10,>=1.3"]
[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "formulaic/_version.py"

# Build target configuration

[tool.hatch.build.targets.sdist]
Expand Down

0 comments on commit 691ce3f

Please sign in to comment.