Skip to content

Commit 5798f0c

Browse files
authored
Merge pull request #89 from bobleesj/cookie-py312
Support Python 3.12 with CI, move tests to top level
2 parents f1162a6 + 2fafe83 commit 5798f0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+94
-191
lines changed

Diff for: .github/workflows/tests-on-pr.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Tests on PR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
validate:
12+
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
13+
with:
14+
project: diffpy.srfit
15+
c_extension: false
16+
headless: false
File renamed without changes.
File renamed without changes.

Diff for: environment.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: diffpy.srfit
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3
6+
- pip

Diff for: pyproject.toml

+44-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,58 @@
1+
[build-system]
2+
requires = ["setuptools>=62.0", "setuptools-git-versioning>=2.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "diffpy.srfit"
7+
dynamic=['version', 'dependencies']
8+
classifiers = [
9+
'Development Status :: 5 - Production/Stable',
10+
'Environment :: Console',
11+
'Intended Audience :: Developers',
12+
'Intended Audience :: Science/Research',
13+
'Operating System :: MacOS :: MacOS X',
14+
'Operating System :: Microsoft :: Windows',
15+
'Operating System :: POSIX',
16+
'Operating System :: Unix',
17+
'Topic :: Scientific/Engineering :: Physics',
18+
'Topic :: Scientific/Engineering :: Chemistry',
19+
]
20+
21+
22+
[tool.setuptools-git-versioning]
23+
enabled = true
24+
template = "{tag}"
25+
dev_template = "{tag}"
26+
dirty_template = "{tag}"
27+
28+
[tool.setuptools.packages.find]
29+
where = ["src"] # list of folders that contain the packages (["."] by default)
30+
include = ["*"] # package names should match these glob patterns (["*"] by default)
31+
exclude = [] # exclude packages matching these glob patterns (empty by default)
32+
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
33+
34+
[tool.setuptools.dynamic]
35+
dependencies = {file = ["requirements/run.txt"]}
36+
137
[tool.black]
238
line-length = 115
339
include = '\.pyi?$'
440
exclude = '''
541
/(
6-
\.git\
42+
\.git
43+
| \.hg
744
| \.mypy_cache
845
| \.tox
946
| \.venv
10-
| _build/
47+
| \.rst
48+
| \.txt
49+
| _build
1150
| buck-out
1251
| build
1352
| dist
53+
54+
# The following are specific to Black, you probably don't want those.
1455
| blib2to3
15-
| tests/data/
16-
| hooks/post_gen_project.py$
17-
| .*\.py$
18-
| .*\.toml$
56+
| tests/data
1957
)/
2058
'''

Diff for: requirements/pip.txt

Whitespace-only changes.

Diff for: requirements/run.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
scipy
2+
numpy
3+
matplotlib

Diff for: requirements/test.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
flake8
2+
pytest
3+
codecov
4+
coverage
5+
pytest-cov
6+
pytest-env

Diff for: setup.py renamed to setup.txt

File renamed without changes.

Diff for: src/diffpy/srfit/.DS_Store

6 KB
Binary file not shown.

Diff for: src/diffpy/srfit/tests/__init__.py

-87
This file was deleted.

Diff for: src/diffpy/srfit/tests/debug.py

-35
This file was deleted.

Diff for: src/diffpy/srfit/tests/run.py

-38
This file was deleted.

Diff for: src/diffpy/srfit/tests/testbuilder.py renamed to tests/test_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import unittest
1919

2020
import numpy
21+
from utils import _makeArgs, noObserversInGlobalBuilders
2122

2223
import diffpy.srfit.equation.builder as builder
2324
import diffpy.srfit.equation.literals as literals
24-
from diffpy.srfit.tests.utils import _makeArgs, noObserversInGlobalBuilders
2525

2626

2727
class TestBuilder(unittest.TestCase):

Diff for: src/diffpy/srfit/tests/testcharacteristicfunctions.py renamed to tests/test_characteristicfunctions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
import unittest
1919

2020
import numpy
21+
from utils import _msg_nosas, has_sas
2122

2223
from diffpy.srfit.sas.sasimport import sasimport
23-
from diffpy.srfit.tests.utils import _msg_nosas, has_sas
2424

2525
# Global variables to be assigned in setUp
2626
cf = None
File renamed without changes.

Diff for: src/diffpy/srfit/tests/testcontribution.py renamed to tests/test_contribution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
import unittest
1919

2020
from numpy import arange, array_equal, dot, sin
21+
from utils import noObserversInGlobalBuilders
2122

2223
from diffpy.srfit.exceptions import SrFitError
2324
from diffpy.srfit.fitbase.fitcontribution import FitContribution
2425
from diffpy.srfit.fitbase.parameter import Parameter
2526
from diffpy.srfit.fitbase.profile import Profile
2627
from diffpy.srfit.fitbase.profilegenerator import ProfileGenerator
27-
from diffpy.srfit.tests.utils import noObserversInGlobalBuilders
2828

2929

3030
class TestContribution(unittest.TestCase):

Diff for: src/diffpy/srfit/tests/testdiffpyparset.py renamed to tests/test_diffpyparset.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
import unittest
2020

2121
import numpy
22-
23-
from diffpy.srfit.tests.utils import _msg_nostructure, has_structure
22+
from utils import _msg_nostructure, has_structure
2423

2524
# Global variables to be assigned in setUp
2625
Atom = Lattice = Structure = DiffpyStructureParSet = None

Diff for: src/diffpy/srfit/tests/testequation.py renamed to tests/test_equation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
import unittest
1919

20+
from utils import _makeArgs, noObserversInGlobalBuilders
21+
2022
import diffpy.srfit.equation.literals as literals
2123
from diffpy.srfit.equation import Equation
22-
from diffpy.srfit.tests.utils import _makeArgs, noObserversInGlobalBuilders
2324

2425

2526
class TestEquation(unittest.TestCase):

Diff for: src/diffpy/srfit/tests/testfitrecipe.py renamed to tests/test_fitrecipe.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
import unittest
1919

2020
from numpy import array_equal, dot, linspace, pi, sin
21+
from utils import capturestdout
2122

2223
from diffpy.srfit.fitbase.fitcontribution import FitContribution
2324
from diffpy.srfit.fitbase.fitrecipe import FitRecipe
2425
from diffpy.srfit.fitbase.parameter import Parameter
2526
from diffpy.srfit.fitbase.profile import Profile
26-
from diffpy.srfit.tests.utils import capturestdout
2727

2828

2929
class TestFitRecipe(unittest.TestCase):

Diff for: src/diffpy/srfit/tests/testfitresults.py renamed to tests/test_fitresults.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
import unittest
1919

20+
from utils import datafile
21+
2022
from diffpy.srfit.fitbase.fitrecipe import FitRecipe
2123
from diffpy.srfit.fitbase.fitresults import initializeRecipe
22-
from diffpy.srfit.tests.utils import datafile
2324

2425

2526
class TestInitializeRecipe(unittest.TestCase):
File renamed without changes.

Diff for: src/diffpy/srfit/tests/testobjcrystparset.py renamed to tests/test_objcrystparset.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
import unittest
1919

2020
import numpy
21-
22-
from diffpy.srfit.tests.utils import _msg_nopyobjcryst, has_pyobjcryst
21+
from utils import _msg_nopyobjcryst, has_pyobjcryst
2322

2423
# Global variables to be assigned in setUp
2524
ObjCrystCrystalParSet = spacegroups = None
File renamed without changes.
File renamed without changes.

Diff for: src/diffpy/srfit/tests/testpdf.py renamed to tests/test_pdf.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@
2020
import unittest
2121

2222
import numpy
23+
from utils import _msg_nosrreal, _msg_nostructure, datafile, has_srreal, has_structure
2324

2425
from diffpy.srfit.exceptions import SrFitError
2526
from diffpy.srfit.pdf import PDFContribution, PDFGenerator, PDFParser
26-
from diffpy.srfit.tests.utils import (
27-
_msg_nosrreal,
28-
_msg_nostructure,
29-
datafile,
30-
has_srreal,
31-
has_structure,
32-
)
3327

3428
# ----------------------------------------------------------------------------
3529

Diff for: src/diffpy/srfit/tests/testprofile.py renamed to tests/test_profile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
import unittest
2121

2222
from numpy import allclose, arange, array, array_equal, ones_like
23+
from utils import datafile
2324

2425
from diffpy.srfit.exceptions import SrFitError
2526
from diffpy.srfit.fitbase.profile import Profile
26-
from diffpy.srfit.tests.utils import datafile
2727

2828

2929
class TestProfile(unittest.TestCase):
File renamed without changes.

0 commit comments

Comments
 (0)