Skip to content

Commit

Permalink
using the latest cookiecutter to make maintenance easier (#93)
Browse files Browse the repository at this point in the history
* use the MolSSI cookiecutter for project structure
  - remove src directory and put alchemtest under the top level
  - update our CI with cookiecutter CI
* fix #92 (support Python 3.12)
* replace versioneer with versioningit
* fix rtd
* add CONTRIBUTING.md and preliminary CODE_OF_CONDUCT.md

NOTE: This commit touched almost every file (mostly due to move) so when running `git blame`,  **exclude this commit from git blame**.
  • Loading branch information
xiki-tempula authored Mar 30, 2024
1 parent 4620f2a commit 6e0917f
Show file tree
Hide file tree
Showing 491 changed files with 769 additions and 2,605 deletions.
14 changes: 14 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Codecov configuration to make it a bit less noisy
coverage:
status:
patch: false
project:
default:
threshold: 50%
comment:
layout: "header"
require_changes: false
branches: null
behavior: default
flags: null
paths: null
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
branch = True
omit =
# omit all tests
src/alchemtest/tests/*
alchemtest/tests/*
# omit the versioneer-installed _version.py
src/alchemtest/_version.py
alchemtest/_version.py

[report]
exclude_lines =
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
src/alchemtest/_version.py export-subst
alchemtest/_version.py export-subst
47 changes: 47 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# How to contribute

We welcome contributions from external contributors, and this document
describes how to merge code changes into this alchemtest.

If you want to **contribute a new test files** then please also read the
[Contributing new data sets](https://alchemtest.readthedocs.io/en/latest/contributing.html)
chapter in the documentation.


## Getting Started

* Make sure you have a [GitHub account](https://github.com/signup/free).
* [Fork](https://help.github.com/articles/fork-a-repo/) this repository on GitHub.
* On your local machine,
[clone](https://help.github.com/articles/cloning-a-repository/) your fork of
the repository.

## Making Changes

* Add some really awesome code to your local fork. It's usually a [good
idea](http://blog.jasonmeridth.com/posts/do-not-issue-pull-requests-from-your-master-branch/)
to make changes on a
[branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/)
with the branch name relating to the feature you are going to add.
* When you are ready for others to examine and comment on your new feature,
navigate to your fork of alchemtest on GitHub and open a [pull
request](https://help.github.com/articles/using-pull-requests/) (PR). Note that
after you launch a PR from one of your fork's branches, all
subsequent commits to that branch will be added to the open pull request
automatically. Each commit added to the PR will be validated for
mergability, compilation and test suite compliance; the results of these tests
will be visible on the PR page.
* If you're providing a new feature, you must add test cases and documentation.
* When the code is ready to go, make sure you run the test suite using pytest.
* When you're ready to be considered for merging, check the "Ready to go"
box on the PR page to let the alchemtest devs know that the changes are complete.
The code will not be merged until this box is checked, the continuous
integration returns checkmarks,
and multiple core developers give "Approved" reviews.

# Additional Resources

* [General GitHub documentation](https://help.github.com/)
* [PR best practices](http://codeinthehole.com/writing/pull-requests-and-other-good-practices-for-teams-using-github/)
* [A guide to contributing to software packages](http://www.contribution-guide.org)
* [Thinkful PR example](http://www.thinkful.com/learn/github-pull-request-tutorial/#Time-to-Submit-Your-First-PR)
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Description
Provide a brief description of the PR's purpose here.

## Todos
Notable points that this PR has either accomplished or will accomplish.
- [ ] TODO 1

## Questions
- [ ] Question1

## Status
- [ ] Ready to go
101 changes: 45 additions & 56 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,63 +24,52 @@ jobs:
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
# Only test lowest and highest version on the expensive/slow
# macOS and windows runners (UPDATE when supported versions change):
exclude:
- os: macOS-latest
python-version: 3.8
- os: macOS-latest
python-version: 3.11
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.11
- os: macOS-latest
python-version: 3.10
- os: macOS-latest
python-version: 3.11
- os: windows-latest
python-version: 3.10
- os: windows-latest
python-version: 3.11

steps:
- uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Install pytest, pytest plugins
run: |
python -m pip install wheel
python -m pip install pytest pytest-cov pytest-pep8
- name: Install package
run: |
python -m pip install .
- name: Run tests

# conda setup requires this special shell
shell: bash -l {0}

run: |
pytest -v --cov=alchemtest --cov-report=xml --color=yes src/alchemtest/tests
- name: CodeCov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
file: ./coverage.xml
flags: unittests
fail_ci_if_error: true

- uses: actions/checkout@v3

# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: test
channels: conda-forge,defaults
extra-specs: |
python=${{ matrix.python-version }}
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
micromamba list
- name: Run tests
# conda setup requires this special shell
shell: bash -l {0}
run: |
pytest -v --cov=alchemtest --cov-report=xml --color=yes alchemtest/tests/
- name: CodeCov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
file: ./coverage.xml
flags: unittests
fail_ci_if_error: true

pypi_check:
name: Check source package integrity (for PyPi deployment)
Expand All @@ -97,12 +86,12 @@ jobs:

- name: Install tools
run: |
python -m pip install setuptools twine
python -m pip install twine build
- name: Build alchemtest source dist
run: |
python setup.py sdist
python -m build --sdist --wheel --outdir dist/
- name: Check package build sdist
run: |
DISTRIBUTION=$(ls -t1 dist/alchemtest-*.tar.gz | head -n 1)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: build
run: |
python -m build --sdist --wheel --outdir dist/
- name: publish_testpypi
# Upload to testpypi on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
Expand Down
117 changes: 111 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,111 @@
docs/_build
src/alchemtest.egg-info
*__pycache__*
.idea
*.DS_Store
build
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

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

# 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/
.coverage
.coverage.*
.cache
.pytest_cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# profraw files from LLVM? Unclear exactly what triggers this
# There are reports this comes from LLVM profiling, but also Xcode 9.
*profraw

# In-tree generated files
*/_version.py
*/.DS_Store
*/.idea/
11 changes: 11 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Configure LGTM for this package

extraction:
python: # Configure Python
python_setup: # Configure the setup
version: 3 # Specify Version 3
path_classifiers:
library:
- devtools/*
generated:
- alchemtest/_version.py
Loading

0 comments on commit 6e0917f

Please sign in to comment.