Skip to content

Commit

Permalink
Fix issues around new _version.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
SethMMorton committed Oct 9, 2024
1 parent 6e818d4 commit 3391dd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ jobs:
python-version: '3.8'

- name: Install MyPy
run: pip install mypy hypothesis pytest pytest-mock fastnumbers
run: pip install mypy hypothesis pytest pytest-mock fastnumbers setuptools_scm

- name: Create _version.py file
run: python -m setuptools_scm --force-write-version-files

- name: Run MyPy
run: mypy --strict natsort tests
Expand Down
2 changes: 1 addition & 1 deletion dev/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
# Remove _version.py
version = pathlib.Path("natsort/_version.py")
if version.is_file():
f.unlink()
version.unlink()
4 changes: 3 additions & 1 deletion natsort/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
try:
from natsort._version import __version__, __version_tuple__
# The redundant "as" tells mypy to treat as explict import
from natsort._version import __version__ as __version__
from natsort._version import __version_tuple__ as __version_tuple__
except ImportError:
__version__ = "unknown version"
__version_tuple__ = (0, 0, "unknown version")
Expand Down

0 comments on commit 3391dd2

Please sign in to comment.