Skip to content

Commit

Permalink
V2 bug fixes, modernization, house-keeping, and README update (#313)
Browse files Browse the repository at this point in the history
* Escape single quotes in sphinx conf. Fixes #142

* Use pyproject.toml package metadata. Fix quote escaping. Fixes #248

* Remove unnecessary pep8 configuration

* Update gitignores

* Use pyproject.toml for package metadata

* Update README for v2

* Add Python 3.11 and 3.12 to CI

* Remove unneeded requirements file reference

* Docs updates

* Update linting and tests

* Fix lint

* Missed one

* Split out code quality job

* Hold on 3.12 for now

* Fix wrong conda environment command

* Fix option name

* Change back and remove python spec since it should already be in environment.yml

* Change hyperlinks to https that support it

* Update joblib link. Supersedes #251

* Remove Python 3.12 for now

* Pin Python version in project package metadata

* Use compatible release operator

---------

Co-authored-by: Jay Qi <jayqi@users.noreply.github.com>
  • Loading branch information
jayqi and jayqi committed Aug 31, 2023
1 parent 4d04432 commit 6968c2a
Show file tree
Hide file tree
Showing 20 changed files with 571 additions and 282 deletions.
50 changes: 39 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,66 @@ name: tests

on:
push:
branches: [master]
branches: [master, v2]
pull_request:
branches: [master, v2]
schedule:
# Run every Sunday
- cron: "0 0 * * 0"
workflow_dispatch:

jobs:
build:
name: ${{ matrix.os }}, Python ${{ matrix.python-version }}
code-quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
pyproject.toml
dev-requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make requirements
- name: Lint
run: |
make lint
tests:
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
needs: code-quality
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: "pip"
cache-dependency-path: |
pyproject.toml
dev-requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make requirements
- name: Lint
run: |
make lint
- name: Run tests
run: |
make test
make test
177 changes: 169 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,177 @@
docs/site/

# OSX Junk
.DS_Store

# test cache
.cache/*
tests/__pycache__/*
*.pytest_cache/
*.pyc
manual_test/

# other local dev info
.vscode/
cookiecutter_data_science.egg-info/

# Mac OS-specific storage files
.DS_Store

# vim
*.swp
*.swo

## https://github.com/github/gitignore/blob/4488915eec0b3a45b5c63ead28f286819c0917de/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ requirements:
## Format the code using isort and black
format:
isort ccds hooks tests
black ccds hooks tests setup.py
black ccds hooks tests

## Lint using flake8 + black
lint:
flake8 ccds hooks tests setup.py
black --check ccds hooks tests setup.py
flake8 ccds hooks tests
black --check ccds hooks tests


### DOCS
Expand Down
Loading

0 comments on commit 6968c2a

Please sign in to comment.