Skip to content

skpkg: setup CI after migrating tests, src, requirements, and .github directory #36

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

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 2 additions & 5 deletions .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Tests on PR

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
validate:
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
tests-on-pr:
uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr.yml@v0
with:
project: diffpy.nmf_mapping
c_extension: false
Expand Down
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__/
.Python
env/
build/
_build/
develop-eggs/
dist/
downloads/
Expand Down Expand Up @@ -90,10 +91,3 @@ target/

# Ipython Notebook
.ipynb_checkpoints

# version information
setup.cfg
/src/diffpy/*/version.cfg

# Rever
rever/
38 changes: 26 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
default_language_version:
python: python3
python: python3
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
autofix_prs: true
autoupdate_branch: 'pre-commit-autoupdate'
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: monthly
skip: [no-commit-to-branch]
submodules: false
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
autofix_prs: true
autoupdate_branch: "pre-commit-autoupdate"
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: monthly
skip: [no-commit-to-branch]
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down Expand Up @@ -47,6 +47,20 @@ repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
- id: codespell
additional_dependencies:
- tomli
# prettier - multi formatter for .json, .yml, and .md files
- repo: https://github.com/pre-commit/mirrors-prettier
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
hooks:
- id: prettier
additional_dependencies:
- "prettier@^3.2.4"
# docformatter - PEP 257 compliant docstring formatter
- repo: https://github.com/s-weigand/docformatter
rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: [--in-place, --config, ./pyproject.toml]
11 changes: 8 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ build-backend = "setuptools.build_meta"
name = "diffpy.nmf_mapping"
dynamic=['version', 'dependencies']
authors = [
{ name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" },
{ name="Simon J.L. Billinge group", email="sb2896@columbia.edu" },
]
maintainers = [
{ name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" },
{ name="Simon J.L. Billinge group", email="sb2896@columbia.edu" },
]
description = "Python package for running NMF analysis on PDF and XRD data."
keywords = ['"diffpy"', '"PDF"', '"NMF"']
keywords = ['diffpy', 'PDF', 'NMF']
readme = "README.rst"
requires-python = ">=3.11, <3.14"
classifiers = [
Expand Down Expand Up @@ -59,6 +59,11 @@ exclude-file = ".codespell/ignore_lines.txt"
ignore-words = ".codespell/ignore_words.txt"
skip = "*.cif,*.dat"

[tool.docformatter]
recursive = true
wrap-summaries = 72
wrap-descriptions = 72

[tool.black]
line-length = 115
include = '\.pyi?$'
Expand Down
Empty file removed requirements/build.txt
Empty file.
1 change: 1 addition & 0 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx
sphinx_rtd_theme
sphinx-copybutton
doctr
m2r
2 changes: 1 addition & 1 deletion src/diffpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
##############################################################################
#
# (c) 2024 The Trustees of Columbia University in the City of New York.
# (c) 2024-2025 The Trustees of Columbia University in the City of New York.
# All rights reserved.
#
# File coded by: Billinge Group members and community contributors.
Expand Down
5 changes: 2 additions & 3 deletions src/diffpy/nmf_mapping/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
##############################################################################
#
# (c) 2024 The Trustees of Columbia University in the City of New York.
# (c) 2024-2025 The Trustees of Columbia University in the City of New York.
# All rights reserved.
#
# File coded by: Billinge Group members and community contributors.
Expand All @@ -12,11 +12,10 @@
# See LICENSE.rst for license information.
#
##############################################################################

"""Python package for running NMF analysis on PDF and XRD data."""

# package version
from diffpy.nmf_mapping.version import __version__
from diffpy.nmf_mapping.version import __version__ # noqa

# silence the pyflakes syntax checker
assert __version__ or True
Expand Down
5 changes: 2 additions & 3 deletions src/diffpy/nmf_mapping/version.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#!/usr/bin/env python
##############################################################################
#
# (c) 2024 The Trustees of Columbia University in the City of New York.
# (c) 2024-2025 The Trustees of Columbia University in the City of New York.
# All rights reserved.
#
# File coded by: Billinge Group members and community contributors.
#
# See GitHub contributions for a more detailed list of contributors.
# https://github.com/diffpy/diffpy.nmf_mapping/graphs/contributors
# https://github.com/diffpy/diffpy.nmf_mapping/graphs/contributors # noqa: E501
#
# See LICENSE.rst for license information.
#
##############################################################################

"""Definition of __version__."""

# We do not use the other three variables, but can be added back if needed.
Expand Down
8 changes: 5 additions & 3 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""Unit tests for __version__.py"""
"""Unit tests for __version__.py."""

import diffpy.nmf_mapping

import diffpy.nmf_mapping # noqa


def test_package_version():
"""Ensure the package version is defined and not set to the initial placeholder."""
"""Ensure the package version is defined and not set to the initial
placeholder."""
assert hasattr(diffpy.nmf_mapping, "__version__")
assert diffpy.nmf_mapping.__version__ != "0.0.0"
Loading