Skip to content

Commit 58a0784

Browse files
committed
Add github actions tests; prepare pyproject.toml
1 parent a44264d commit 58a0784

9 files changed

Lines changed: 250 additions & 1 deletion

File tree

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
target-branch: "2.X"
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
target-branch: "2.X"

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 12 * * 0'
8+
9+
jobs:
10+
11+
build_sdist_and_wheel:
12+
name: Build sdist and wheel
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 60
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.13'
20+
21+
- name: Install build requirements
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install build-essential cmake
25+
pip install --upgrade -r build_requirements.txt
26+
27+
- name: make
28+
shell: bash
29+
run: |
30+
python -m build
31+
32+
- name: upload sdist and wheel
33+
if: always()
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: dist
37+
path: dist
38+
39+
- name: Install wheel
40+
run: |
41+
pip install dist/*.whl
42+
43+
- name: Install test requirements & set configuration variables
44+
run: |
45+
pip install -r test_requirements.txt
46+
47+
- name: make test
48+
shell: bash
49+
run: |
50+
python -m pytest -rsap -x tests
51+
52+
- name: Install doc requirements
53+
run: |
54+
pip install -r doc_requirements.txt
55+
56+
- name: build docs
57+
shell: bash
58+
run: |
59+
cd doc
60+
sphinx-build -b html . _build/html
61+
62+
- name: upload docs
63+
if: always()
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: casm-tools-docs
67+
path: doc/_build/html

.github/workflows/test-linux.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Testing on ubuntu-latest
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 12 * * 0'
8+
9+
env:
10+
SKBUILD_BUILD_OPTIONS: --verbose
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.13'
21+
22+
- name: Install build requirements
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install build-essential cmake
26+
pip install --upgrade -r build_requirements.txt
27+
28+
- name: make
29+
shell: bash
30+
run: |
31+
pip install .
32+
33+
- name: Install test requirements & set configuration variables
34+
run: |
35+
pip install -r test_requirements.txt
36+
37+
- name: test
38+
shell: bash
39+
run: |
40+
python -m pytest -rsap -x -m "not requires_ase" tests
41+
42+
- name: make with ase
43+
shell: bash
44+
run: |
45+
pip install ".[ase]"
46+
47+
- name: test with requires_ase
48+
shell: bash
49+
run: |
50+
python -m pytest -rsap -x -m "requires_ase" tests
51+
52+

.github/workflows/test-macos.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Testing on macos-latest
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 12 * * 0'
8+
9+
jobs:
10+
build:
11+
runs-on: macOS-latest
12+
timeout-minutes: 60
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.13'
18+
19+
- name: Install build requirements
20+
run: |
21+
brew update
22+
brew install cmake
23+
pip install --upgrade -r build_requirements.txt
24+
25+
- name: make
26+
shell: bash
27+
run: |
28+
pip install .
29+
30+
- name: Install test requirements & set configuration variables
31+
run: |
32+
pip install -r test_requirements.txt
33+
34+
- name: make test
35+
shell: bash
36+
run: |
37+
python -m pytest -rsap -x -m "not requires_ase" tests
38+
39+
- name: make
40+
shell: bash
41+
run: |
42+
pip install ".[ase]"
43+
44+
- name: make test ase
45+
shell: bash
46+
run: |
47+
python -m pytest -rsap -x -m "requires_ase" tests
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Testing Python versions on ubuntu-latest
2+
3+
on:
4+
schedule:
5+
- cron: '0 12 * * 0'
6+
workflow_dispatch: # Allows manual triggering
7+
8+
env:
9+
SKBUILD_BUILD_OPTIONS: --verbose
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 60
15+
strategy:
16+
matrix:
17+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install build requirements
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install build-essential cmake
29+
pip install --upgrade -r build_requirements.txt
30+
31+
- name: make
32+
shell: bash
33+
run: |
34+
pip install .
35+
36+
- name: Install test requirements & set configuration variables
37+
run: |
38+
pip install -r test_requirements.txt
39+
40+
- name: test
41+
shell: bash
42+
run: |
43+
python -m pytest -rsap -x -m "not requires_ase" tests
44+
45+
- name: make with ase
46+
shell: bash
47+
run: |
48+
pip install ".[ase]"
49+
50+
- name: test with requires_ase
51+
shell: bash
52+
run: |
53+
python -m pytest -rsap -x -m "requires_ase" tests

casm/tools/calc/commands/status.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
import sys
55
import typing
66

7+
# Note:
8+
# The command `casm-calc status` is implemented by `run_status` which requires
9+
# `casm.project` to be installed. This is a bit odd, because `casm.tools` is a
10+
# dependency of `casm.project`. At some point `casm-calc status` will be refactored
11+
# to be a plugin provided by `casm.project`.
12+
713
if typing.TYPE_CHECKING:
814
import argparse
915

casm/tools/calc/commands/submit.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
"""Implements ``casm-calc submit ...``"""
22

3+
# Note:
4+
# The command `casm-calc submit` is implemented by `run_submit` which requires
5+
# `casm.project` to be installed. This is a bit odd, because `casm.tools` is a
6+
# dependency of `casm.project`. At some point `casm-calc submit` will be refactored
7+
# to be a plugin provided by `casm.project`.
8+
39

410
def run_submit(args):
511
"""Implements ``casm-calc submit ...``

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "casm-tools"
10-
version = "1.0a1"
10+
version = "2.0a1"
1111
authors = [
1212
{ name="CASM developers", email="casm-developers@lists.engr.ucsb.edu" },
1313
]
@@ -25,6 +25,7 @@ dependencies = [
2525
"libcasm-mapping>=2.0.1",
2626
"libcasm-configuration>=2.0.0",
2727
"numpy",
28+
"tabulate",
2829
]
2930

3031
[project.optional-dependencies]

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
libcasm-xtal>=2.0.1
2+
libcasm-mapping>=2.0.1
3+
libcasm-configuration>=2.0.0
4+
numpy
5+
tabulate

0 commit comments

Comments
 (0)