Skip to content

Commit 972098b

Browse files
committed
Removed versionner issue hed-standard#1181
1 parent 386d3af commit 972098b

12 files changed

Lines changed: 71 additions & 722 deletions

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
include versioneer.py
1+
22
include hed/_version.py
33
include requirements.txt

RELEASE_GUIDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ git push origin main
149149

150150
### 2. Create GitHub release
151151

152-
The project uses [versioneer](https://github.com/python-versioneer/python-versioneer) for version management, which automatically derives the version from git tags. We'll create the release tag and release directly on GitHub.
152+
The project uses [setuptools-scm](https://github.com/pypa/setuptools_scm) for version management, which automatically derives the version from git tags. We'll create the release tag and release directly on GitHub.
153153

154154
#### 2.1 Navigate to create release
155155

@@ -538,8 +538,8 @@ git fetch upstream --tags
538538
# Verify tag exists
539539
git tag -l
540540

541-
# Check versioneer can find it
542-
python -c "import hed._version; print(hed._version.get_versions())"
541+
# Check setuptools-scm can find the version
542+
python -m setuptools_scm
543543
```
544544

545545
#### Issue: Build fails with "No module named X"
@@ -703,7 +703,7 @@ python -m twine upload dist/* # Upload
703703
## Additional Resources
704704

705705
- [Python Packaging Guide](https://packaging.python.org/)
706-
- [Versioneer Documentation](https://github.com/python-versioneer/python-versioneer)
706+
- [setuptools-scm Documentation](https://github.com/pypa/setuptools_scm)
707707
- [PyPI Help](https://pypi.org/help/)
708708
- [Semantic Versioning](https://semver.org/)
709709
- [HED Documentation](https://www.hedtags.org/)

hed/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
from hed.schema.hed_schema_group import HedSchemaGroup
1616
from hed.schema.hed_schema_io import load_schema, load_schema_version
1717

18+
try:
19+
from hed._version import __version__
20+
except ImportError:
21+
# Version file not generated yet (editable install without build)
22+
from importlib.metadata import version, PackageNotFoundError
1823

19-
from . import _version
20-
21-
__version__ = _version.get_versions()["version"]
24+
try:
25+
__version__ = version("hedtools")
26+
except PackageNotFoundError:
27+
__version__ = "unknown"

0 commit comments

Comments
 (0)