-
Notifications
You must be signed in to change notification settings - Fork 548
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 #714 from JacksonBurns/v2/fix_ci_or_else
[v2]: CI Overhaul (and make v2 actually _pass_ the CI)
- Loading branch information
Showing
38 changed files
with
442 additions
and
140 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
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,114 @@ | ||
# ci.yml | ||
# | ||
# Continuous Integration for Chemprop - checks build, code formatting, and runs tests for all | ||
# proposed changes and on a regular schedule | ||
# | ||
# Note: this file contains extensive inline documentation to aid with knowledge transfer. | ||
|
||
name: Continuous Integration | ||
|
||
on: | ||
# run on pushes/pull requests to/against main or v2/dev | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main, v2/dev] | ||
# run this in the morning on weekdays to catch dependency issues | ||
schedule: | ||
- cron: "0 8 * * 1-5" | ||
# allow manual runs | ||
workflow_dispatch: | ||
|
||
# cancel previously running tests if new commits are made | ||
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix | ||
concurrency: | ||
group: actions-id-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Check Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
# clone the repo, attempt to build | ||
- uses: actions/checkout@v4 | ||
- run: python -m pip install build | ||
- run: python -m build . | ||
|
||
lint: | ||
name: Check Formatting | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
# clone the repo, run black and flake8 on it | ||
- uses: actions/checkout@v4 | ||
- run: python -m pip install black==23.* flake8 | ||
- run: black --check . | ||
- run: flake8 . | ||
|
||
test: | ||
name: Execute Tests | ||
needs: lint | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
# run with a login shell (so that the conda environment is activated) | ||
# and echo the commands we run as we do them (for debugging purposes) | ||
shell: bash -el {0} | ||
strategy: | ||
# if one platform/python version fails, continue testing the others | ||
fail-fast: false | ||
matrix: | ||
# test on all platforms with both supported versions of Python | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: [3.11, 3.12] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# use a version of the conda virtual environment manager to set up an | ||
# isolated environment with the Python version we want | ||
- uses: mamba-org/setup-micromamba@main | ||
with: | ||
environment-name: temp | ||
condarc: | | ||
channels: | ||
- defaults | ||
- conda-forge | ||
channel_priority: flexible | ||
create-args: | | ||
python=${{ matrix.python-version }} | ||
- name: Install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install nbmake | ||
python -m pip install ".[dev,docs,test]" | ||
- name: Test with pytest | ||
shell: bash -l {0} | ||
run: | | ||
pytest -v tests | ||
- name: Test notebooks | ||
shell: bash -l {0} | ||
run: | | ||
pytest --nbmake examples/training.ipynb | ||
pytest --nbmake examples/predicting.ipynb | ||
pytest --nbmake examples/convert_v1_to_v2.ipynb | ||
pytest --nbmake examples/training_regression_multicomponent.ipynb | ||
pytest --nbmake examples/predicting_regression_multicomponent.ipynb | ||
# GitHub allows you to set checks as required before PRs can be merged, which is annoying to do | ||
# for matrix jobs like the one above which have six actual jobs. Instead we have a summary job | ||
# like this, which we mark as required. | ||
# Copied in part from: | ||
# https://github.com/orgs/community/discussions/26822#discussioncomment-3305794 | ||
ci-report-status: | ||
name: report CI status | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
result="${{ needs.test.result }}" | ||
if test $result == "success"; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi | ||
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from . import data, featurizers, models, nn, utils, conf, exceptions, schedulers | ||
|
||
__all__ = ["data", "featurizers", "models", "nn", "utils", "conf", "exceptions", "schedulers"] | ||
|
||
__version__ = "2.0.0-rc.1" |
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
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
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
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
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 |
---|---|---|
@@ -1,4 +1,41 @@ | ||
from .atom import MultiHotAtomFeaturizer, AtomFeaturizer | ||
from .bond import MultiHotBondFeaturizer, BondFeaturizer | ||
from .molgraph import * | ||
from .molecule import * | ||
from .molgraph import ( | ||
MolGraph, | ||
MoleculeMolGraphFeaturizer, | ||
SimpleMoleculeMolGraphFeaturizer, | ||
RxnMolGraphFeaturizer, | ||
CondensedGraphOfReactionFeaturizer, | ||
CGRFeaturizer, | ||
RxnMode, | ||
) | ||
from .molecule import ( | ||
MoleculeFeaturizer, | ||
MorganFeaturizerMixin, | ||
BinaryFeaturizerMixin, | ||
CountFeaturizerMixin, | ||
MorganBinaryFeaturizer, | ||
MorganCountFeaturizer, | ||
MoleculeFeaturizerRegistry, | ||
) | ||
|
||
__all__ = [ | ||
"MultiHotAtomFeaturizer", | ||
"AtomFeaturizer", | ||
"MultiHotBondFeaturizer", | ||
"BondFeaturizer", | ||
"MolGraph", | ||
"MoleculeMolGraphFeaturizer", | ||
"SimpleMoleculeMolGraphFeaturizer", | ||
"RxnMolGraphFeaturizer", | ||
"CondensedGraphOfReactionFeaturizer", | ||
"CGRFeaturizer", | ||
"RxnMode", | ||
"MoleculeFeaturizer", | ||
"MoleculeFeaturizerRegistry", | ||
"MorganFeaturizerMixin", | ||
"BinaryFeaturizerMixin", | ||
"CountFeaturizerMixin", | ||
"MorganBinaryFeaturizer", | ||
"MorganCountFeaturizer", | ||
] |
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
Oops, something went wrong.