Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade package and repo infrastructure #156

Open
wants to merge 45 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
672529e
Update .gitignore
AAriam May 10, 2023
302422f
remove `versioneer`
AAriam May 10, 2023
255d781
Update MANIFEST.in
AAriam May 10, 2023
d6fc11f
transition to `pyproject.toml` from `setup.py`
AAriam May 10, 2023
10e80c3
add `__version__` using `versioningit`
AAriam May 10, 2023
c7c78e5
add .gitattributes for automatic versioning using `versioningit`
AAriam May 10, 2023
10df2c4
update workflows to run on push or pull request for 'dev' branch as w…
AAriam May 10, 2023
4c3da61
update GitHub workflows
AAriam May 10, 2023
7cf9264
Delete __init__.py from tests folder
AAriam May 10, 2023
f7590a5
delete dummy test module; leftover from cookiecutter template
AAriam May 10, 2023
c8e7c95
move `tests` directory to root.
AAriam May 10, 2023
87ac57a
update copyright notice in LICENSE
AAriam May 10, 2023
0fb3b67
update email address in CODE_OF_CONDUCT.md
AAriam May 10, 2023
4b316a7
add PEP 561 marker file
AAriam May 10, 2023
9e7edda
update path to tests directory in CI workflow
AAriam May 10, 2023
e3e29e7
update path to tests directory in CI workflow
AAriam May 10, 2023
073d381
Merge branch 'dev' of https://github.com/Armin-Ariamajd/opencadd into…
AAriam May 10, 2023
63508e5
temporarily remove `mmlinger` build from CI to speed up tests
AAriam May 10, 2023
7e97ab5
update paths to data files in unit tests
AAriam May 10, 2023
f2b65ac
downgrade Python version for docs and lint workflows to work with pin…
AAriam May 10, 2023
371b6b9
add back mmlinger build in CI workflow
AAriam May 10, 2023
5340d4f
update path to tests data
AAriam May 10, 2023
d2523e2
merge docs workflow into CI
AAriam May 10, 2023
4ef05c9
add `windows-latest` to OS matrix
AAriam May 11, 2023
5d37130
clean up format
AAriam May 11, 2023
27c2bd3
remove redundant step from lint workflow
AAriam May 11, 2023
bd97512
replace `conda-incubator` with `provision-with-micromamba` for Lint job
AAriam May 11, 2023
9834ddb
fix typo
AAriam May 11, 2023
8715e0c
add explicit python version
AAriam May 11, 2023
1ecb36a
Update ci.yaml
AAriam May 11, 2023
7066846
Update ci.yaml
AAriam May 11, 2023
f8e597e
Update ci.yaml
AAriam May 11, 2023
dd95f20
Update ci.yaml
AAriam May 11, 2023
cb80448
Update ci.yaml
AAriam May 11, 2023
568cdcc
Update ci.yaml
AAriam May 11, 2023
4340e9b
Update ci.yaml
AAriam May 11, 2023
90a4d36
Update ci.yaml
AAriam May 11, 2023
4f8591d
Update ci.yaml
AAriam May 11, 2023
96abbe3
suppress pylint error on dynamic `__version__`
AAriam May 11, 2023
4a82f58
Update ci.yaml
AAriam May 11, 2023
fbd4322
remove version pins
AAriam May 11, 2023
fe0043a
Update .pylintrc
AAriam May 11, 2023
a8ee93c
Update .pylintrc
AAriam May 11, 2023
c810617
delete leftover sample file from cookiecutter template
AAriam May 11, 2023
4797fe9
clean up format
AAriam May 11, 2023
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opencadd/_version.py export-subst
102 changes: 61 additions & 41 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,69 +1,72 @@
#!/bin/bash

name: CI

on:

push:
branches:
- "master"
- "dev"

pull_request:
branches:
- "master"
- "dev"

schedule:
# Run a cron job once weekly on Monday
- cron: "0 3 * * 1"

jobs:

test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}

name: Test (OS ${{ matrix.os }}, Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: [3.7, 3.8]
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
env:
CI_OS: ${{ matrix.os }}
PYVER: ${{ matrix.python-version }}
PACKAGE: "opencadd"

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Additional info about the build
- name: Additional build info
shell: bash
run: |
uname -a
df -h
ulimit -a

- uses: conda-incubator/setup-miniconda@v2
- name: Install dependencies
uses: mamba-org/provision-with-micromamba@main
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: test
environment-file: devtools/conda-envs/test_env.yaml
channels: conda-forge,defaults,bioconda
cache-env: true
extra-specs: |
python=${{ matrix.python-version }}

# TODO: Remove this step when patched theseus makes it to CF
- name: Build patched mmligner
shell: bash -l {0}
run: |
conda activate base
conda install conda-build
micromamba install conda-build
conda build devtools/conda-recipes/mmligner/

- name: Install package
- name: Install OpenCADD
shell: bash -l {0}
run: |
conda install -c local mmligner pip
micromamba install -c local mmligner pip
python -m pip install . --no-deps
conda list
micromamba list

- name: Run tests
- name: Run unit tests
shell: bash -l {0}
run: |
pytest -v --cov=${PACKAGE} --cov-report=xml --color=yes ${PACKAGE}/tests/
run: pytest -v --cov=${PACKAGE} --cov-report=xml --color=yes tests/

- name: CodeCov
uses: codecov/codecov-action@v1
Expand All @@ -73,39 +76,56 @@ jobs:
flags: unittests
yml: ./.codecov.yml

#############
lint-format:
lint:
name: Static code analysis
runs-on: ubuntu-latest
env:
CI_OS: ubuntu-latest
PACKAGE: "opencadd"
PYVER: "3.8"

steps:
- name: Checkout the code
- name: Checkout
uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- name: Install dependencies
uses: mamba-org/provision-with-micromamba@v15
with:
python-version: "3.8"
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: test
environment-file: devtools/conda-envs/test_env.yaml
channels: conda-forge,defaults,bioconda
cache-env: true

- name: Install linter and formatter
- name: Lint (pylint)
shell: bash -l {0}
run: |
conda install -y pylint black
run: pylint $PACKAGE/

- name: Code-style (black -l 99)
shell: bash -l {0}
if: always()
run: black --check -l 99 $PACKAGE/

docs:
name: Sphinx docs
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run pylint
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- name: Install dependencies
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: devtools/conda-envs/test_env.yaml
cache-env: true

- name: Install OpenCADD
shell: bash -l {0}
run: |
pylint $PACKAGE/
python -m pip install . --no-deps
micromamba list

- name: Run black check
- name: Build Sphinx docs
shell: bash -l {0}
if: always()
run: |
black --check -l 99 $PACKAGE/
cd docs
make clean
SPHINXOPTS="-W -T --keep-going" make html
46 changes: 0 additions & 46 deletions .github/workflows/docs.yaml

This file was deleted.

11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,13 @@ ENV/
.mypy_cache/

# VSCode
.vscode/
.vscode/

# In-tree generated files
*/_version.py

# PyCharm
.idea/

# MacOS files
.DS_Store
Loading