Skip to content

Commit

Permalink
Merge pull request #73 from bobleesj/scikit-package
Browse files Browse the repository at this point in the history
Apply `scikit-package` v0.1.0 to `cifkit` - autoamtic docformatter, prettier, codespell
  • Loading branch information
bobleesj authored Jan 4, 2025
2 parents 68d6016 + d0200b4 commit e5fd787
Show file tree
Hide file tree
Showing 72 changed files with 657 additions and 1,152 deletions.
14 changes: 14 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
coverage:
status:
project: # more options at https://docs.codecov.com/docs/commit-status
default:
target: auto # use the coverage from the base commit, fail if coverage is lower
threshold: 0% # allow the coverage to drop by

comment:
layout: " diff, flags, files"
behavior: default
require_changes: false
require_base: false # [true :: must have a base report to post]
require_head: false # [true :: must have a head report to post]
hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]
2 changes: 2 additions & 0 deletions .codespell/ignore_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
;; Please include filenames and explanations for each ignored line.
;; See https://docs.openverse.org/meta/codespell.html for docs.
20 changes: 20 additions & 0 deletions .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
;; Please include explanations for each ignored word (lowercase).
;; See https://docs.openverse.org/meta/codespell.html for docs.

;; abbreviation for "materials" often used in a journal title
mater

;; alternative use of socioeconomic
socio-economic

;; Frobenius norm used in np.linalg.norm
fro

;; indide is chemical name
indide

;; used as a date
nd

;; chemical
te
56 changes: 48 additions & 8 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,55 @@ labels: "release"
assignees: ""
---

### Release checklist for GitHub contributors
### PyPI/GitHub rc-release preparation checklist:

- [ ] All PRs/issues attached to the release are merged.
- [ ] All the badges on the README are passing.
- [ ] License information is verified as correct. If you are unsure, please
comment below.
- [ ] Locally rendered documentation contains all appropriate pages, including
API references (check no modules are missing), tutorials, and other human
written text is up-to-date with any changes in the code.
- [ ] Installation instructions in the README, documentation and on the website
are updated and tested
- [ ] Successfully run any tutorial examples or do functional testing in some
other way.
- [ ] Grammar and writing quality have been checked (no typos).
API references (check no modules are missing), tutorials, and other
human-written text is up-to-date with any changes in the code.
- [ ] Installation instructions in the README, documentation, and the website
(e.g., diffpy.org) are updated.
- [ ] Successfully run any tutorial examples or do functional testing with the
latest Python version.
- [ ] Grammar and writing quality are checked (no typos).
- [ ] Install `pip install build twine`, run `python -m build` and
`twine check dist/*` to ensure that the package can be built and is
correctly formatted for PyPI release.

Please mention @bobleesj here when you are ready for PyPI/GitHub release.
Include any additional comments necessary, such as version information and
details about the pre-release here:

### PyPI/GitHub full-release preparation checklist:

- [ ] Create a new conda environment and install the rc from PyPI
(`pip install <package-name>==??`)
- [ ] License information on PyPI is correct.
- [ ] Docs are deployed successfully to `https://www.diffpy.org/<package-name>`.
- [ ] Successfully run all tests, tutorial examples or do functional testing.

Please let @bobleesj know that all checks are done and the package is ready for
full release.

### conda-forge release preparation checklist:

<!-- After @bobleesj releases the PyPI package, please check the following when creating a PR for conda-forge release.-->

- [ ] Ensure that the full release has appeared on PyPI successfully.
- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to
`meta.yaml` in the feedstock.
- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have
questions.
- [ ] Tag @bobleesj for conda-forge release.

### Post-release checklist

<!-- Before closing this issue, please complete the following: -->

- [ ] Run tutorial examples and conduct functional testing using the
installation guide in the README. Attach screenshots/results as comments.
- [ ] Documentation (README, tutorials, API references, and websites) is
deployed without broken links or missing figures.
22 changes: 0 additions & 22 deletions .github/pull_request_template.md

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Release (GitHub/PyPI)
name: Release (GitHub/PyPI) and Deploy Docs

on:
workflow_dispatch:
push:
tags:
- '*'
- "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml

jobs:
release:
permissions:
contents: write
uses: bobleesj/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
with:
project: cifkit
c_extension: false
github_admin_username: bobleesj
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/check-news-item.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Check for News

on:
pull_request_target:
branches:
- main

jobs:
build:
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@{{ VERSION/v0 }}
check-news-item:
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0
with:
project: cifkit
42 changes: 20 additions & 22 deletions .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,27 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Create virtual environment and install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install .
- name: Test with pytest and generate coverage report
run: |
source venv/bin/activate
pip install pytest pytest-cov
python -m pytest -m "not pyvista" --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Create virtual environment and install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install .
- name: Test with pytest and generate coverage report
run: |
source venv/bin/activate
pip install pytest pytest-cov
python -m pytest -m "not pyvista" --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
102 changes: 31 additions & 71 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@
__pycache__/
*.py[cod]
*$py.class
.DS_Store


# Test file
test.ipynb

# C extensions
*.so

nodemon.json
debug/
.ruff_cache

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
Expand All @@ -28,12 +20,14 @@ lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
venv/
*.egg-info/
.installed.cfg
*.egg
bin/
temp/
tags/
errors.err

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -44,89 +38,55 @@ share/python-wheels/
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
MANIFEST

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

# Translations
*.mo
*.pot

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

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

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/build/
docs/source/generated/

# pytest
.pytest_cache/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# 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/
# Editor files
# mac
.DS_Store
*~

# pytype static type analyzer
.pytype/
# vim
*.swp
*.swo

# Cython debug symbols
cython_debug/
# pycharm
.idea/

# VS Code settings
# VSCode
.vscode/

# Ipython Notebook
.ipynb_checkpoints
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[settings]
# Keep import statement below line_length character limit
line_length = 90
multi_line_output = 3
include_trailing_comma = True
Loading

0 comments on commit e5fd787

Please sign in to comment.