Skip to content
Merged
8 changes: 7 additions & 1 deletion .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: PR Tests

permissions:
contents: read
pull-requests: write

on:
pull_request:
branches:
Expand All @@ -8,6 +12,8 @@ on:

jobs:
pr-tests:
uses: CitrineInformatics/common-gh-actions/.github/workflows/run-tests.yml@v1
uses: CitrineInformatics/common-gh-actions/.github/workflows/run-tests.yml@v1.1
with:
src: gemd
skip_38: true
include_313: true
2 changes: 1 addition & 1 deletion gemd/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1.11"
__version__ = "2.2.0"
3 changes: 1 addition & 2 deletions gemd/units/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def _format_clean(unit, registry, **options):
"""
try: # Informal route changed in 0.22
from pint.formatting import _FORMATTERS
formatter = _FORMATTERS["D"]
formatter = _FORMATTERS["D"] # pragma: no cover
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unreachable with the current library limits, but is reachable for older versions of Pint. Kept to avoid being "breaking" without a major version bump.

except ImportError: # pragma: no cover
from pint import Unit
formatter_obj = registry.formatter._formatters["D"]
Expand All @@ -317,7 +317,6 @@ def _surrogate_formatter(unit, registry, **options):
parsed = Unit(unit)
return formatter_obj.format_unit(parsed)
except ValueError:
parsed = Unit(unit)
return formatter_obj.format_quantity(unit)

formatter = _surrogate_formatter
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pint==0.21
pint==0.24.4
deprecation==2.1.0
typing-extensions==4.8.0
importlib-resources==5.3.0
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
setup(name='gemd',
# Update this in gemd/__version__.py
version=version,
python_requires='>=3.8',
python_requires='>=3.9',
url='http://github.com/CitrineInformatics/gemd-python',
description="Python binding for Citrine's GEMD data model",
author='Citrine Informatics',
Expand All @@ -33,14 +33,14 @@
'tests.units': ['test_units.txt']
},
install_requires=[
"pint>=0.21,<0.25,!=0.22,!=0.23", # pint 0.22,0.23 have a bad interaction w/ numpy >= 2
"pint>=0.24.4,<0.25",
"deprecation>=2.1.0,<3",
"typing_extensions>=4.8,<5",
"importlib-resources>=5.3,<7"
],
extras_require={
"scripts": [
"packaging"
"packaging",
"sphinx==5.0.0",
"sphinx-rtd-theme==1.0.0",
"sphinxcontrib-apidoc==0.3.0",
Expand All @@ -52,16 +52,16 @@
"pandas>=2.0.3,<3"
],
"tests.entity.bounds": [
"numpy>=1.24.4,<3",
"numpy>=1.24.4,<2; python_version<='3.10'",
"pandas>=2.0.3,<3"
]
},
classifiers=[
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
)
5 changes: 4 additions & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
flake8==7.0.0
flake8-docstrings==1.7.0
numpy==1.24.4; python_version<'3.10'
pandas==2.0.3; python_version<'3.10'
numpy>=2.0.2,<=2.1.0; python_version>='3.10'
pandas==2.3.0; python_version>='3.10'
Comment on lines +3 to +6
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some unfortunate import errors if we're not careful about numpy/pandas/Pint combinations

pytest==8.0.0
pytest-cov==4.1.0
pandas>=2.0.3,<2.2.0 # includes a compatible version of numpy
derp==0.1.1
Loading