-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test and release to GitHub actions
- Loading branch information
Showing
3 changed files
with
74 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Install package | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[dev] | ||
- name: Test with pytest | ||
working-directory: ./pytest | ||
run: | | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Release package | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
pypi: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build twine hatch hatch-vcs | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
python -m build | ||
python -m twine upload -r testpypi dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,7 @@ description = "Python implementation of the Aperiodic-Fourier Modal Method for e | |
readme = "README.md" | ||
license = { text = "MIT" } | ||
requires-python = ">=3.10" | ||
authors = [ | ||
{ name = "Marco Passoni", email = "[email protected]" }, | ||
] | ||
authors = [{ name = "Marco Passoni", email = "[email protected]" }] | ||
keywords = [ | ||
'photonics', | ||
'simulation', | ||
|
@@ -32,18 +30,15 @@ classifiers = [ | |
"Topic :: Scientific/Engineering :: Physics", | ||
] | ||
dependencies = [ | ||
"matplotlib>=3.5.1", | ||
"numpy>=1.23.1", | ||
"pandas>=1.4.2", | ||
"scipy>=1.8.0", | ||
"matplotlib>=3.5.1", | ||
"numpy>=1.23.1", | ||
"pandas>=1.4.2", | ||
"scipy>=1.8.0", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"toml>=0.10.2", | ||
"hatch-vcs==0.3.0", | ||
] | ||
dev = ["toml>=0.10.2", "hatch-vcs==0.3.0", "pytest>=7.2.0"] | ||
doc = [ | ||
"sphinx>=5.3.0", | ||
"sphinx-rtd-theme>=1.1.1", | ||
|
@@ -52,9 +47,7 @@ doc = [ | |
] | ||
|
||
[tool.hatch.build] | ||
include = [ | ||
"A_FMM/*", | ||
] | ||
include = ["A_FMM/*"] | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
|
@@ -63,4 +56,4 @@ source = "vcs" | |
version_scheme = "post-release" | ||
|
||
[tool.hatch.build.hooks.vcs] | ||
version-file = "A_FMM/_version.py" | ||
version-file = "A_FMM/_version.py" |