Skip to content

Commit 42c0eb8

Browse files
committed
ci: update pypi workflow for pyproject
1 parent 3d6bbeb commit 42c0eb8

4 files changed

Lines changed: 22 additions & 14 deletions

File tree

.github/workflows/pythonpublish.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ jobs:
1515
python-version: '3.x'
1616
- name: Install dependencies
1717
run: |
18-
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine==5.0.0
18+
python -m pip install --upgrade pip build twine
2019
21-
- name: Build and publish
20+
- name: Build distribution artifacts
21+
run: |
22+
# this will read pyproject.toml and produce both sdist and wheel in dist/
23+
python -m build --sdist --wheel
24+
25+
- name: Publish to PyPI
2226
env:
2327
TWINE_USERNAME: __token__
2428
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2529
run: |
26-
python setup.py sdist bdist_wheel
2730
twine upload dist/*

devito/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
__version_tuple__: VERSION_TUPLE
1818
version_tuple: VERSION_TUPLE
1919

20-
__version__ = version = '4.8.17.dev27+g2041a3834.d20250516'
21-
__version_tuple__ = version_tuple = (4, 8, 17, 'dev27', 'g2041a3834.d20250516')
20+
__version__ = version = '4.8.17.dev29+g21522abe2.d20250519'
21+
__version_tuple__ = version_tuple = (4, 8, 17, 'dev29', 'g21522abe2.d20250519')

devito/types/basic.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,14 +386,21 @@ def _filter_assumptions(cls, **kwargs):
386386

387387
return assumptions, kwargs
388388

389+
@staticmethod
390+
def __xnew__(cls, name, **assumptions):
391+
# Create the new Symbol
392+
# Note: use __xnew__ to bypass sympy caching
393+
newobj = sympy.Symbol.__xnew__(cls, name, **assumptions)
394+
# Prevent the caching of the assumptions that we handle through _eval_is_xxx
395+
newobj._assumptions = {k: v for k, v in newobj._assumptions.items()
396+
if k not in ('real', 'imaginary', 'complex')}
397+
return newobj
398+
389399
def __new__(cls, *args, **kwargs):
390400
name = kwargs.get('name') or args[0]
391401
assumptions, kwargs = cls._filter_assumptions(**kwargs)
392402

393-
# Create the new Symbol
394-
# Note: use __xnew__ to bypass sympy caching
395-
newobj = sympy.Symbol.__xnew__(cls, name, **assumptions)
396-
newobj._assumptions = cls.default_assumptions
403+
newobj = cls.__xnew__(cls, name, **assumptions)
397404

398405
# Initialization
399406
newobj._dtype = cls.__dtype_setup__(**kwargs)
@@ -557,10 +564,7 @@ def __new__(cls, *args, **kwargs):
557564
# Not in cache. Create a new Symbol via sympy.Symbol
558565
args = list(args)
559566
name = kwargs.pop('name', None) or args.pop(0)
560-
561-
# Note: use __xnew__ to bypass sympy caching
562-
newobj = sympy.Symbol.__xnew__(cls, name, **assumptions)
563-
newobj._assumptions = cls.default_assumptions
567+
newobj = cls.__xnew__(cls, name, **assumptions)
564568

565569
# Initialization
566570
newobj._dtype = cls.__dtype_setup__(**kwargs)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,4 @@ exclude = ["docs", "tests", "examples"]
6868

6969
[tool.setuptools_scm]
7070
version_file = "devito/_version.py"
71+
fallback_version = "0+untagged"

0 commit comments

Comments
 (0)