Skip to content

Commit

Permalink
PKG #267 apply PyPA changes, similar to gemviz
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Oct 17, 2023
1 parent 15a71a9 commit 4d4dbb2
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 2,848 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ source=hkl

[report]
omit=
# ignore _version.py and versioneer.py
# ignore _version.py
.*version.*
*_version.py
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exclude =
__pycache__,
build,
dist,
versioneer.py,
docs/source,
hkl/_version.py,
dev_*
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/upload_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ jobs:

steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
# with:
# python-version: 3.9
- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install OS packages
run: >-
sudo apt update
&& sudo apt install -y libgirepository1.0-dev
- name: Install pypa/build
run: >-
python -m
Expand All @@ -40,16 +44,6 @@ jobs:
run: >-
twine check dist/*
# NOTE: "Secrets" page, not "Environments"
# NOTE: testpypi upload with versioneer only works on new tags.
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
# verbose: true

# TODO: restrict to tags on main branch only?
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ include hkl/_version.py
include pyproject.toml
include pytest.ini
include requirements.txt
include versioneer.py

recursive-include docs *.rst conf.py Makefile make.bat
recursive-include Makefile README.md *.ipynb resources/*
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ v1.1 (expected 2024)

User-requested changes

Maintenance
-----------

* Update packaging to latest PyPA recommendations.

v1.0.4 (released 2023-10-06)
======================================

Expand Down
12 changes: 9 additions & 3 deletions hkl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

from ._version import get_versions # noqa: F402, E402
try:
from setuptools_scm import get_version

__version__ = get_versions()["version"]
del get_versions
__version__ = get_version(root="..", relative_to=__file__)
del get_version
except (LookupError, ModuleNotFoundError):
from importlib.metadata import version

__version__ = version("pkgdemo")
del version

# gobject-introspection, to access libhkl
import gi
Expand Down
Loading

0 comments on commit 4d4dbb2

Please sign in to comment.