Skip to content

Commit 28963a8

Browse files
Project management systems and metadata
Patch/metadata 2 (#20)
2 parents d108cff + ab04674 commit 28963a8

File tree

5 files changed

+165
-146
lines changed

5 files changed

+165
-146
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,59 @@ name: Continuous Integration
33
on:
44
pull_request:
55
branches: [main, dev]
6-
6+
77
jobs:
88

99
static-analysis:
1010
name: Perform static analysis
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 15
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Set up Pixi
17+
uses: prefix-dev/setup-pixi@v0.8.1
18+
with:
19+
pixi-version: v0.40.2
20+
cache: false
21+
environments: fmt
22+
activate-environment: true
23+
- name: Run formatter and linter
24+
run: pixi run fmt
25+
26+
test:
27+
name: Perform tests
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 15
1330
strategy:
1431
matrix:
15-
python-version: ['3.13']
16-
aiida-version: ['stable']
32+
environment: [test-py311, test-py312, test-py313]
1733
steps:
18-
- uses: actions/checkout@v4
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
- name: Install project manager
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install hatch
27-
- name: Run formatter and linter
28-
run: |
29-
hatch fmt --check
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Set up Pixi
37+
uses: prefix-dev/setup-pixi@v0.8.1
38+
with:
39+
pixi-version: v0.40.2
40+
cache: false
41+
environments: ${{ matrix.environment }}
42+
activate-environment: true
43+
- name: Run tests
44+
run: pixi run test
3045

3146
docs:
3247
name: Generate documentation
3348
runs-on: ubuntu-latest
3449
timeout-minutes: 15
35-
strategy:
36-
matrix:
37-
python-version: ['3.13']
38-
aiida-version: ['stable']
3950
steps:
40-
- uses: actions/checkout@v4
41-
- name: Set up Python ${{ matrix.python-version }}
42-
uses: actions/setup-python@v5
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
- name: Set up Pixi
54+
uses: prefix-dev/setup-pixi@v0.8.1
4355
with:
44-
python-version: ${{ matrix.python-version }}
45-
- name: Install project manager
46-
run: |
47-
python -m pip install --upgrade pip
48-
pip install hatch
56+
pixi-version: v0.40.2
57+
cache: false
58+
environments: docs
59+
activate-environment: true
4960
- name: Build docs
50-
run: |
51-
hatch run docs:build
52-
53-
# tests:
54-
# name: Run tests
61+
run: pixi run build-docs

.github/workflows/release.yml

Lines changed: 31 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,43 @@ on:
55
types: [released]
66

77
jobs:
8-
# build:
9-
# name: Generate release builds
10-
# runs-on: ubuntu-latest
11-
# timeout-minutes: 15
12-
# strategy:
13-
# matrix:
14-
# python-version: ['3.13']
15-
# aiida-version: ['stable']
16-
# steps:
17-
# - uses: actions/checkout@v4
18-
# - name: Set up Python ${{ matrix.python-version }}
19-
# uses: actions/setup-python@v5
20-
# with:
21-
# python-version: ${{ matrix.python-version }}
22-
# - name: Install project manager
23-
# run: |
24-
# python -m pip install --upgrade pip
25-
# pip install hatch
26-
# - name: Run builder
27-
# run: |
28-
# hatch build
29-
30-
# publish:
31-
# name: Upload release to PyPI
32-
# needs: build
33-
# runs-on: ubuntu-latest
34-
# timeout-minutes: 15
35-
# strategy:
36-
# matrix:
37-
# python-version: ['3.13']
38-
# aiida-version: ['stable']
39-
# environment:
40-
# name: pypi
41-
# url: https://pypi.org/p/aiida-fans
42-
# permissions:
43-
# id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
44-
# steps:
45-
# - uses: actions/checkout@v4
46-
# - name: Set up Python ${{ matrix.python-version }}
47-
# uses: actions/setup-python@v5
48-
# with:
49-
# python-version: ${{ matrix.python-version }}
50-
# - name: Publish package distributions to PyPI
51-
# uses: pypa/gh-action-pypi-publish@release/v1
8+
build:
9+
name: Generate release builds
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 15
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Set up Pixi
16+
uses: prefix-dev/setup-pixi@v0.8.1
17+
with:
18+
pixi-version: v0.40.2
19+
cache: false
20+
environments: build
21+
activate-environment: true
22+
- name: Build distributions
23+
run: pixi run build-dist
24+
- name: Upload release distributions
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: release-dists
28+
path: dist/
5229

53-
release:
54-
name: Create release
30+
publish:
31+
needs: build
32+
name: Upload release to PyPI
5533
runs-on: ubuntu-latest
5634
timeout-minutes: 15
57-
strategy:
58-
matrix:
59-
python-version: ['3.13']
60-
aiida-version: ['stable']
6135
environment:
6236
name: pypi
6337
url: https://pypi.org/p/aiida-fans
6438
permissions:
6539
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
6640
steps:
67-
- uses: actions/checkout@v4
68-
- name: Set up Python ${{ matrix.python-version }}
69-
uses: actions/setup-python@v5
70-
with:
71-
python-version: ${{ matrix.python-version }}
72-
- name: Install project manager
73-
run: |
74-
python -m pip install --upgrade pip
75-
pip install hatch
76-
- name: Run builder
77-
run: |
78-
hatch build
79-
- name: Publish package distributions to PyPI
80-
uses: pypa/gh-action-pypi-publish@release/v1
81-
41+
- name: Retrieve release distributions
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: release-dists
45+
path: dist/
46+
- name: Publish package distributions to PyPI
47+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ coverage.xml
3939
cover/
4040

4141
# Environments
42+
.pixi
4243
.python-version
4344
.env
4445
.venv
@@ -52,5 +53,10 @@ venv.bak/
5253
docs/build/
5354

5455
# Auto-generated during builds
55-
/src/hatch/_version.py
5656
_version.py
57+
58+
# Auto-generated during pull requests
59+
diff.md
60+
61+
# Lock file
62+
*.lock

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The design goals of this plugin are primarily to provide as simplistic a user ex
2222
- [ ] documentation expansion
2323
- [ ] input validation developed in cooperation with the FANS team
2424
- [ ] file sharing optimisations
25-
- [ ] greater database integration via output analysis/extraction
25+
- [ ] greater database integration via output analysis/extraction
2626

2727
## Installation
2828
The plugin is currently unavailable via PyPI at this stage in development, but it is intended to be published upon an upcoming functional release.

pyproject.toml

Lines changed: 87 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,94 @@ description = "AiiDA plugin for FANS, an FFT-based homogenization solver."
55
urls = {Documentation = "http://aiida-fans.readthedocs.io/en/latest/", Source = "https://github.com/ethan-shanahan/aiida-fans" }
66
authors = [{name = "Ethan Shanahan", email = "ethan.shanahan@gmail.com"}]
77
readme = "README.md"
8-
license = "GPL-3.0-only"
9-
8+
license = {file = "LICENSE"}
109
classifiers = [
1110
"Natural Language :: English",
1211
"Programming Language :: Python",
1312
"Operating System :: POSIX :: Linux",
1413
"Intended Audience :: Science/Research",
1514
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
16-
"Development Status :: 1 - Planning",
15+
"Development Status :: 3 - Alpha",
1716
"Framework :: AiiDA"
1817
]
1918
keywords = ["aiida", "plugin", "fans"]
20-
21-
requires-python = ">= 3.11"
19+
requires-python = ">=3.11"
2220
dependencies = [
2321
"aiida-core>=2.3"
2422
]
2523

26-
[project.optional-dependencies]
27-
docs = [
28-
"sphinx"
29-
]
30-
3124
# Entry Points
32-
[project.entry-points."aiida.data"]
33-
"fans" = "aiida_fans.data:FANSParameters"
34-
[project.entry-points."aiida.calculations"]
35-
"fans" = "aiida_fans.calculations:FANSCalculation"
36-
[project.entry-points."aiida.parsers"]
37-
"fans" = "aiida_fans.parsers:FANSParser"
38-
[project.entry-points."aiida.cmdline.data"]
39-
"fans" = "aiida_fans.cli:data_cli"
25+
[project.entry-points]
26+
"aiida.data" = { "fans" = "aiida_fans.data:FANSParameters" }
27+
"aiida.calculations" = { "fans" = "aiida_fans.calculations:FANSCalculation" }
28+
"aiida.parsers" = { "fans" = "aiida_fans.parsers:FANSParser" }
29+
"aiida.cmdline.data" = { "fans" = "aiida_fans.cli:data_cli" }
4030

41-
# Build
31+
# Build System
4232
[build-system]
43-
build-backend = "hatchling.build"
44-
requires = ["hatchling", "hatch-vcs"]
45-
[tool.hatch.version]
46-
source = "vcs"
47-
[tool.hatch.build.hooks.vcs]
48-
version-file = "src/aiida_fans/_version.py"
33+
requires = ["setuptools>=64", "setuptools_scm>=8"]
34+
build-backend = "setuptools.build_meta"
35+
36+
37+
# Tools
38+
39+
## Project Tools: pixi
40+
[tool.pixi.project]
41+
channels = ["conda-forge"]
42+
platforms = ["linux-64"]
4943

50-
# Build - Docs
51-
[tool.hatch.envs.docs]
52-
features = ["docs"]
53-
[tool.hatch.envs.docs.scripts]
54-
build = "sphinx-build -M html docs/source docs/build"
44+
### pixi: default dependencies (in addition to aiida-core)
45+
[tool.pixi.dependencies]
46+
fans = "*"
47+
[tool.pixi.pypi-dependencies]
48+
# None
5549

56-
# Formatting Configuration
50+
### pixi: default tasks
51+
[tool.pixi.tasks]
52+
# None
53+
54+
### pixi: features (in addition to fans)
55+
[tool.pixi.feature.dev]
56+
pypi-dependencies = {aiida-fans = { path = ".", editable = true }}
57+
[tool.pixi.feature.prod]
58+
pypi-dependencies = {aiida-fans = { path = ".", editable = true }}
59+
[tool.pixi.feature.fmt]
60+
dependencies = {ruff = "*"}
61+
tasks = {fmt = "ruff check", dummy = "echo dummy", my-dummy="echo my-dummy"}
62+
[tool.pixi.feature.build]
63+
pypi-dependencies = {build = "*"}
64+
tasks = {build-dist = "python -m build"}
65+
[tool.pixi.feature.docs]
66+
dependencies = {sphinx = "*"}
67+
tasks = {build-docs = "sphinx-build -M html docs/source docs/build"}
68+
[tool.pixi.feature.test]
69+
dependencies = {pytest = "*"}
70+
tasks = {test = "echo dummy test passes"}
71+
[tool.pixi.feature.py3]
72+
dependencies = {python = ">=3.11"}
73+
[tool.pixi.feature.py311]
74+
dependencies = {python = "3.11.*"}
75+
[tool.pixi.feature.py312]
76+
dependencies = {python = "3.12.*"}
77+
[tool.pixi.feature.py313]
78+
dependencies = {python = "3.13.*"}
79+
80+
### pixi: environments
81+
[tool.pixi.environments]
82+
dev = { features = ["dev", "fmt", "test"], solve-group = "default" }
83+
fmt = { features = ["fmt", "py3"], no-default-feature = true }
84+
build = { features = ["build", "py3"], no-default-feature = true }
85+
docs = { features = ["docs", "py3"], no-default-feature = true }
86+
test-py311 = { features = ["prod", "test", "py311"], solve-group = "py311" }
87+
test-py312 = { features = ["prod", "test", "py312"], solve-group = "py312" }
88+
test-py313 = { features = ["prod", "test", "py313"], solve-group = "py313" }
89+
90+
91+
## Build Tools: setuptools_scm
92+
[tool.setuptools_scm]
93+
version_file = "src/aiida_fans/_version.py"
94+
95+
## Style Tools: ruff
5796
[tool.ruff]
5897
extend-exclude = ["conf.py"]
5998
line-length = 120
@@ -63,24 +102,25 @@ ignore = [
63102
"D417" # Documentation for every function parameter
64103
]
65104
select = [
66-
'E', # pydocstyle
67-
'W', # pydocstyle
68-
"D", # pydocstyle
69-
'F', # pyflakes
70-
'I', # isort
71-
'N', # pep8-naming
72-
'PLC', # pylint-convention
73-
'PLE', # pylint-error
74-
'PLR', # pylint-refactor
75-
'PLW', # pylint-warning
76-
'RUF' # ruff
105+
'E', # pydocstyle
106+
'W', # pydocstyle
107+
"D", # pydocstyle
108+
'F', # pyflakes
109+
'I', # isort
110+
'N', # pep8-naming
111+
'PLC', # pylint-convention
112+
'PLE', # pylint-error
113+
'PLR', # pylint-refactor
114+
'PLW', # pylint-warning
115+
'RUF' # ruff
77116
]
78-
# Allow unused variables when underscore-prefixed.
79-
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
80-
[tool.ruff.lint.pydocstyle]
81-
convention = "google"
117+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" # Allow unused variables when underscore-prefixed.
118+
pydocstyle = {convention = "google"}
82119

83-
# Testing Configuration
120+
## Test Tools: pytest
84121
[tool.pytest.ini_options]
85122
[tool.coverage]
86123
source = ["src/aiida_fans"]
124+
125+
## Docs Tools: sphinx
126+
# None

0 commit comments

Comments
 (0)