Skip to content

Commit 74f5ddd

Browse files
authored
Merge pull request #69 from jcapriot/pyproject
Pyproject.toml
2 parents 0d2a7da + 5fe9513 commit 74f5ddd

26 files changed

+417
-224
lines changed

.git_archival.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4+
ref-names: $Format:%D$

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.git_archival.txt export-subst
2+
# Excluding files from an sdist generated by meson-python
3+
4+
.github/* export-ignore
5+
docs/* export-ignore
6+
examples/* export-ignore
7+
tests/* export-ignore
8+
9+
.coveragerc export-ignore
10+
.flake8 export-ignore
11+
.git* export-ignore
12+
*.yml export-ignore
13+
*.yaml export-ignore

.github/workflows/test_with_conda.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: ["ubuntu-latest"]
23-
python-version: [3.8, 3.9, "3.10", "3.11"]
23+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
2424

2525
steps:
2626
- uses: actions/checkout@v2
@@ -35,11 +35,14 @@ jobs:
3535
libdlf
3636
cython
3737
setuptools_scm
38+
meson-python>=0.14.0
39+
meson
40+
ninja
41+
build
3842
discretize
3943
matplotlib
4044
jupyter
4145
utm
42-
numba
4346
pytest
4447
pytest-cov
4548
sphinx
@@ -49,16 +52,20 @@ jobs:
4952
graphviz
5053
pillow
5154
cache-environment: true
55+
- name: Install numba
56+
if: matrix.python-version != '3.12'
57+
# Numba doesn't work on python 3.12 just yet, so conditionally install it into the environment:
58+
run: |
59+
micromamba install numba
5260
- name: Install Our Package
5361
run: |
54-
export BUILD_GEOANA_EXT=1
55-
pip install -e .
62+
pip install --no-build-isolation --editable . --config-settings=setup-args="-Dwith_extensions=true"
5663
conda list
5764
- name: Run Tests
5865
run: |
5966
pytest --cov-config=.coveragerc --cov=geoana --cov-report=xml -s -v -W ignore::DeprecationWarning
6067
- name: "Upload coverage to Codecov"
61-
if: ${{ matrix.python-version }} == '3.10'
68+
if: matrix.python-version == '3.11'
6269
uses: codecov/codecov-action@v3
6370
with:
6471
token: ${{ secrets.CODECOV_TOKEN }}
@@ -84,6 +91,10 @@ jobs:
8491
libdlf
8592
cython
8693
setuptools_scm
94+
meson-python>=0.14.0
95+
meson
96+
ninja
97+
build
8798
discretize
8899
matplotlib
89100
jupyter
@@ -100,8 +111,7 @@ jobs:
100111
cache-environment: true
101112
- name: Prepare source distribution
102113
run: |
103-
export BUILD_GEOANA_EXT=1
104-
python setup.py sdist
114+
python -m build --no-isolation --skip-dependency-check --sdist . --config-settings=setup-args="-Dwith_extensions=true"
105115
- name: Publish package
106116
uses: pypa/gh-action-pypi-publish@release/v1
107117
with:
@@ -110,8 +120,7 @@ jobs:
110120
skip_existing: true
111121
- name: Install package
112122
run: |
113-
export BUILD_GEOANA_EXT=1
114-
pip install -e .
123+
pip install --no-build-isolation --editable . --config-settings=setup-args="-Dwith_extensions=true"
115124
- name: Build documentation
116125
run: |
117126
cd docs

MANIFEST.in

Lines changed: 0 additions & 6 deletions
This file was deleted.

geoana/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
__author__ = 'SimPEG developers'
66
__license__ = 'MIT'
7-
__copyright__ = 'Copyright 2017 SimPEG developers'
7+
__copyright__ = 'Copyright 2023 SimPEG developers'
8+
9+
from importlib.metadata import version, PackageNotFoundError
810

911
# Version
1012
try:
1113
# - Released versions just tags: 0.8.0
1214
# - GitHub commits add .dev#+hash: 0.8.1.dev4+g2785721
1315
# - Uncommitted changes add timestamp: 0.8.1.dev4+g2785721.d20191022
14-
from geoana.version import version as __version__
15-
except ImportError:
16+
__version__ = version("geoana")
17+
except PackageNotFoundError:
1618
# If it was not installed, then we don't know the version. We could throw a
17-
# warning here, but this case *should* be rare. discretize should be
19+
# warning here, but this case *should* be rare. geoana should be
1820
# installed properly!
1921
from datetime import datetime
2022

geoana/earthquake/meson.build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
python_sources = [
3+
'__init__.py',
4+
'oksar.py',
5+
]
6+
7+
py.install_sources(
8+
python_sources,
9+
subdir: 'geoana/earthquake'
10+
)

geoana/em/fdem/meson.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
python_sources = [
3+
'__init__.py',
4+
'base.py',
5+
'halfspace.py',
6+
'layered.py',
7+
'simple_functions.py',
8+
'wholespace.py',
9+
]
10+
11+
py.install_sources(
12+
python_sources,
13+
subdir: 'geoana/em/fdem'
14+
)

geoana/em/meson.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
python_sources = [
3+
'__init__.py',
4+
'base.py',
5+
]
6+
7+
py.install_sources(
8+
python_sources,
9+
subdir: 'geoana/em'
10+
)
11+
12+
subdir('fdem')
13+
subdir('static')
14+
subdir('tdem')

geoana/em/setup.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

geoana/em/static/meson.build

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
python_sources = [
3+
'__init__.py',
4+
'freespace.py',
5+
'halfspace.py',
6+
'sphere.py',
7+
'wholespace.py',
8+
]
9+
10+
py.install_sources(
11+
python_sources,
12+
subdir: 'geoana/em/static'
13+
)

0 commit comments

Comments
 (0)