Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches:
- main
pull_request:
branches:
- main
- devel
- packaging-updates
types:
- opened
- reopened
- synchronize
- ready_for_review


concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request'}}

jobs:
build-lint-pytest:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install uv
python -m pip install flake8 pytest
uv pip compile pyproject.toml -o requirements.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install package
run: pip install -e .
- name: Test with pytest
run: |
pytest
71 changes: 71 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Publish Python Package

on:
push:
tags:
- '[0-9]*.[0-9]*.[0-9]*'
- 'v[0-9]*.[0-9]*.[0-9]*'

permissions:
contents: write # Required for creating a GitHub release
id-token: write # Required for trusted publishing to PyPI

jobs:
create-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: |
This is an automated release for version ${{ github.ref_name }}.
draft: false
prerelease: false

release-build:
runs-on: ubuntu-latest
needs: create-release

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build release distributions
run: |
python -m pip install build
python -m build

- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest
needs: release-build
environment:
name: release
url: https://pypi.org/project/ammber

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ __pycache__
../build
dist
*egg-info
*.pyc
*.pyc

*.DS_Store
*.vscode
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ authors = [
{ name = "Xander Mensah", email = "xmen@umich.edu" },
{ name = "Katsuyo Thornton", email = "kthorn@umich.edu" }
]
license = { file = "LICENSE.md" }
license = "MIT"
license-files = ["LICENSE.md"]
readme = "README.md"

requires-python = ">=2.7, <4"
Expand All @@ -50,13 +51,13 @@ dependencies = [
classifiers=[
'Development Status :: 1 - Planning',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
]

[tool.setuptools.packages.find]
include = ["ammber"]

[project.urls]
Homepage = "https://github.com/UMThorntongroup/"
89 changes: 89 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml -o requirements.txt
contourpy==1.3.0
# via matplotlib
coverage==7.8.0
# via pytest-cov
cycler==0.12.1
# via matplotlib
flexcache==0.3
# via pint
flexparser==0.4
# via pint
fonttools==4.57.0
# via matplotlib
iniconfig==2.1.0
# via pytest
kiwisolver==1.4.8
# via matplotlib
matplotlib==3.10.1
# via pycalphad
numpy==1.26.4
# via
# ammber (pyproject.toml)
# contourpy
# matplotlib
# pandas
# pycalphad
# scipy
# xarray
packaging==24.2
# via
# matplotlib
# pytest
# setuptools-scm
# xarray
pandas==2.2.3
# via xarray
pillow==11.2.1
# via matplotlib
pint==0.24.4
# via pycalphad
platformdirs==4.3.7
# via pint
pluggy==1.5.0
# via pytest
pycalphad==0.11.0
# via ammber (pyproject.toml)
pyparsing==3.2.3
# via
# matplotlib
# pycalphad
pytest==8.3.5
# via
# pycalphad
# pytest-cov
pytest-cov==6.1.1
# via pycalphad
python-dateutil==2.9.0.post0
# via
# matplotlib
# pandas
pytz==2025.2
# via pandas
runtype==0.5.3
# via pycalphad
scipy==1.15.2
# via
# ammber (pyproject.toml)
# pycalphad
setuptools==78.1.0
# via setuptools-scm
setuptools-scm==8.2.0
# via pycalphad
six==1.17.0
# via python-dateutil
symengine==0.14.0
# via pycalphad
tinydb==4.8.2
# via pycalphad
typing-extensions==4.13.2
# via
# flexcache
# flexparser
# pint
# pycalphad
tzdata==2025.2
# via pandas
xarray==2025.3.1
# via pycalphad