Skip to content

Commit 19170fa

Browse files
authored
Merge pull request #141 from djhoese/versioning-setuptools-scm
2 parents 28bb051 + 7cc650b commit 19170fa

File tree

11 files changed

+77
-333
lines changed

11 files changed

+77
-333
lines changed

.git_archival.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true)$
4+
ref-names: $Format:%D$

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst

.github/workflows/deploy-sdist.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ jobs:
1515

1616
- name: Create sdist
1717
shell: bash -l {0}
18-
run: python setup.py sdist
18+
run: |
19+
pip install build
20+
python -m build -s
1921
2022
- name: Publish package to PyPI
2123
if: github.event.action == 'published'

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
build
2+
dist
23
*.egg-info
34
*.pyc
45
*.pyd
6+
__pycache__
57
libtiff/version.py
6-
8+
*.so

libtiff/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
__all__ = ['TIFF', 'TIFF3D', 'TIFFfile', 'TiffArray', 'TiffFile',
2020
'TiffFiles', 'TiffChannelsAndFiles', 'TiffBase']
2121

22+
try:
23+
from libtiff.version import version as __version__ # noqa
24+
except ModuleNotFoundError:
25+
raise ModuleNotFoundError(
26+
"No module named libtiff.version. This could mean "
27+
"you didn't install 'pylibtiff' properly. Try reinstalling ('pip "
28+
"install').")
2229

2330
from .libtiff_ctypes import libtiff, TIFF, TIFF3D # noqa: F401
2431
from .tiff import TIFFfile, TIFFimage, TiffArray # noqa: F401

libtiff/scripts/convert.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
import os
88

9-
### START UPDATE SYS.PATH ###
10-
### END UPDATE SYS.PATH ###
11-
129
description_template = '''
1310
DimensionX: %(DimensionX)s
1411
DimensionY: %(DimensionY)s

libtiff/scripts/info.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
import os # noqa: F401
88

9-
### START UPDATE SYS.PATH ###
10-
### END UPDATE SYS.PATH ###
11-
129

1310
def runner(parser, options, args):
1411

libtiff/setup.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2", 'setuptools_scm_git_archive', 'oldest-supported-numpy']
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
write_to = "libtiff/version.py"
7+

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ max-line-length = 120
44
# Ignore all docstring errors for now
55
ignore = D
66

7+
[coverage:run]
8+
relative_files = True
9+
omit =
10+
libtiff/version.py
11+
libtiff/tiff_h_*.py

0 commit comments

Comments
 (0)