Skip to content

Commit

Permalink
Merge pull request #141 from djhoese/versioning-setuptools-scm
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese authored Dec 13, 2022
2 parents 28bb051 + 7cc650b commit 19170fa
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 333 deletions.
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true)$
ref-names: $Format:%D$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
4 changes: 3 additions & 1 deletion .github/workflows/deploy-sdist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:

- name: Create sdist
shell: bash -l {0}
run: python setup.py sdist
run: |
pip install build
python -m build -s
- name: Publish package to PyPI
if: github.event.action == 'published'
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
build
dist
*.egg-info
*.pyc
*.pyd
__pycache__
libtiff/version.py

*.so
7 changes: 7 additions & 0 deletions libtiff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
__all__ = ['TIFF', 'TIFF3D', 'TIFFfile', 'TiffArray', 'TiffFile',
'TiffFiles', 'TiffChannelsAndFiles', 'TiffBase']

try:
from libtiff.version import version as __version__ # noqa
except ModuleNotFoundError:
raise ModuleNotFoundError(
"No module named libtiff.version. This could mean "
"you didn't install 'pylibtiff' properly. Try reinstalling ('pip "
"install').")

from .libtiff_ctypes import libtiff, TIFF, TIFF3D # noqa: F401
from .tiff import TIFFfile, TIFFimage, TiffArray # noqa: F401
Expand Down
3 changes: 0 additions & 3 deletions libtiff/scripts/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

import os

### START UPDATE SYS.PATH ###
### END UPDATE SYS.PATH ###

description_template = '''
DimensionX: %(DimensionX)s
DimensionY: %(DimensionY)s
Expand Down
3 changes: 0 additions & 3 deletions libtiff/scripts/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

import os # noqa: F401

### START UPDATE SYS.PATH ###
### END UPDATE SYS.PATH ###


def runner(parser, options, args):

Expand Down
75 changes: 0 additions & 75 deletions libtiff/setup.py

This file was deleted.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2", 'setuptools_scm_git_archive', 'oldest-supported-numpy']
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "libtiff/version.py"

5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ max-line-length = 120
# Ignore all docstring errors for now
ignore = D

[coverage:run]
relative_files = True
omit =
libtiff/version.py
libtiff/tiff_h_*.py
Loading

0 comments on commit 19170fa

Please sign in to comment.