-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from Open-Catalyst-Project/gh-actions
GH actions
- Loading branch information
Showing
8 changed files
with
142 additions
and
93 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 6 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[dev] | ||
- name: black | ||
run: | | ||
black --color ocdata |
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,50 @@ | ||
name: test | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 10 | ||
matrix: | ||
python_version: ['3.9', '3.10', '3.11'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
- name: Install dependencies and package | ||
# this can be added along with a dependabot config to run tests with latest versions | ||
# pip install -r requirements.txt | ||
# pip install -r requirements-optional.txt | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[dev] | ||
- name: Test with pytest | ||
run: | | ||
pytest tests -vv --cov-report=xml --cov=ocpdata | ||
- if: ${{ matrix.python_version == '3.11' }} | ||
name: codecov-report | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: false # optional (default = false) | ||
files: ./coverage.xml | ||
token: ${{ secrets.CODECOV_TOKEN }} # required | ||
verbose: true # optional (default = false) |
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
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,54 @@ | ||
[build-system] | ||
requires = ["setuptools>=69"] | ||
|
||
[project] | ||
name = "oc-data" | ||
description = "Code for generating adsorbate-catalyst input configurations" | ||
readme = "README.md" | ||
license = {text = "MIT License"} | ||
version = "0.2.0" | ||
requires-python = ">=3.9, <3.13" | ||
dependencies = [ | ||
"scipy", | ||
"numpy", | ||
"ase==3.22.1", | ||
"pymatgen", | ||
"tqdm" | ||
] | ||
|
||
[tool.setuptools.packages] | ||
find = {namespaces = false} # Disable implicit namespaces | ||
|
||
[tool.setuptools_scm] # for version instrospection based on tags + commit | ||
|
||
[project.urls] | ||
repository = "http://github.com/Open-Catalyst-Project/Open-Catalyst-Dataset" | ||
|
||
# include package data | ||
[tool.setuptools.package-data] | ||
"ocdata.databases.pkls" = ["*pkl"] | ||
|
||
[project.optional-dependencies] | ||
dev = ["pre-commit", "pytest", "pytest-cov", "coverage", "black"] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "-p no:warnings --import-mode importlib -x --quiet -rxXs --color yes" | ||
filterwarnings = [ | ||
'ignore::UserWarning', | ||
'ignore::FutureWarning', | ||
'ignore::RuntimeWarning' | ||
] | ||
testpaths = ["tests"] | ||
|
||
[tool.coverage.run] | ||
source = ["ocdata"] | ||
|
||
[tool.isort] | ||
profile = 'black' | ||
skip_gitignore = true | ||
multi_line_output=3 | ||
include_trailing_comma = true | ||
force_grid_wrap = 0 | ||
use_parentheses = true | ||
line_length = 88 |
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
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