Skip to content

Commit

Permalink
Remove cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Feb 28, 2024
1 parent d9edeec commit c51466e
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 205 deletions.
12 changes: 0 additions & 12 deletions .copier-answers.yml

This file was deleted.

51 changes: 1 addition & 50 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,14 @@ description of best practices for developing scientific packages.

[spc-dev-intro]: https://learn.scientific-python.org/development/

# Quick development

The fastest way to start with development is to use nox. If you don't have nox,
you can use `pipx run nox` to run it without installing, or `pipx install nox`.
If you don't have pipx (pip for applications), then you can install with
`pip install pipx` (the only case were installing an application with regular
pip is reasonable). If you use macOS, then pipx and nox are both in brew, use
`brew install pipx nox`.

To use, run `nox`. This will lint and test using every installed version of
Python on your system, skipping ones that are not installed. You can also run
specific jobs:

```console
$ nox -s lint # Lint only
$ nox -s tests # Python tests
$ nox -s docs -- --serve # Build and serve the docs
$ nox -s build # Make an SDist and wheel
```

Nox handles everything for you, including setting up an temporary virtual
environment for each run.

# Setting up a development environment manually

You can set up a development environment by running:

```bash
python3 -m venv .venv
source ./.venv/bin/activate
pip install -v -e .[dev]
pip install -e .[dev]
```

If you have the
Expand Down Expand Up @@ -73,29 +50,3 @@ Use pytest-cov to generate coverage reports:
```bash
pytest --cov=harmonwig
```

# Building docs

You can build the docs using:

```bash
nox -s docs
```

You can see a preview with:

```bash
nox -s docs -- --serve
```

# Pre-commit

This project uses pre-commit for all style checking. While you can run it with
nox, this is such an important tool that it deserves to be installed on its own.
Install pre-commit and run:

```bash
pre-commit run -a
```

to check all files.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
groups:
actions:
patterns:
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: CD
name: Publish

on:
workflow_dispatch:
release:
pull_request:
push:
branches:
- main
release:
types:
- published
tags:
- "v*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -48,5 +47,4 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'
with:
# Remember to tell (test-)pypi about this repo before publishing
# Remove this line to publish to PyPI
repository-url: https://test.pypi.org/legacy/
28 changes: 8 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
Expand All @@ -24,29 +23,21 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: pre-commit/[email protected].0
python-version: "3.11"
- uses: pre-commit/[email protected].1
with:
extra_args: --hook-stage manual --all-files
- name: Run PyLint
run: |
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
pipx run nox -s pylint

checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
python-version: ["3.7", "3.12"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]

include:
- python-version: pypy-3.10
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -55,15 +46,12 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install package
run: python -m pip install .[test]
run: pip install .[dev]

- name: Test package
run: >-
python -m pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20
run: pytest -ra --cov --cov-report=xml --cov-report=term

- name: Upload coverage report
uses: codecov/codecov-action@v3.1.4
uses: codecov/codecov-action@v4
51 changes: 3 additions & 48 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,21 @@ ci:
autofix_commit_msg: "style: pre-commit fixes"

repos:
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.*]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
types_or: [yaml, markdown]
args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.14"
rev: "v0.2.2"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -50,28 +27,7 @@ repos:
rev: "v1.8.0"
hooks:
- id: mypy
files: src|tests
args: []
additional_dependencies:
- pytest

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
hooks:
- id: codespell

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
hooks:
- id: shellcheck

- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
exclude: .pre-commit-config.yaml
files: src

- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.16"
Expand All @@ -84,4 +40,3 @@ repos:
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs
18 changes: 0 additions & 18 deletions .readthedocs.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
# harmonwig

[![Actions Status][actions-badge]][actions-link]
[![Documentation Status][rtd-badge]][rtd-link]

[![PyPI version][pypi-version]][pypi-link]
[![Conda-Forge][conda-badge]][conda-link]
[![PyPI platforms][pypi-platforms]][pypi-link]

[![GitHub Discussion][github-discussions-badge]][github-discussions-link]

<!-- prettier-ignore-start -->
[actions-badge]: https://github.com/ispg-group/harmonwig/workflows/CI/badge.svg
[actions-link]: https://github.com/ispg-group/harmonwig/actions
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/harmonwig
[conda-link]: https://github.com/conda-forge/harmonwig-feedstock
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
[github-discussions-link]: https://github.com/ispg-group/harmonwig/discussions
[pypi-link]: https://pypi.org/project/harmonwig/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/harmonwig
[pypi-version]: https://img.shields.io/pypi/v/harmonwig
[rtd-badge]: https://readthedocs.org/projects/harmonwig/badge/?version=latest
[rtd-link]: https://harmonwig.readthedocs.io/en/latest/?badge=latest

<!-- prettier-ignore-end -->
34 changes: 4 additions & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
requires = ["flit_core>=3.4"]
build-backend = "flit_core.buildapi"


[project]
name = "harmonwig"
authors = [
Expand Down Expand Up @@ -34,13 +33,10 @@ dynamic = ["version"]
dependencies = []

[project.optional-dependencies]
test = [
"pytest >=6",
"pytest-cov >=3",
]
dev = [
"pytest >=6",
"pytest-cov >=3",
"pytest ~= 7.0",
"pytest-cov >= 3",
"pre-commit",
]

[project.urls]
Expand All @@ -50,7 +46,6 @@ Changelog = "https://github.com/ispg-group/harmonwig/releases"


[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = [
Expand All @@ -71,7 +66,7 @@ report.exclude_also = [

[tool.mypy]
files = ["src", "tests"]
python_version = "3.8"
python_version = "3.7"
warn_unused_configs = true
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
Expand All @@ -84,7 +79,6 @@ module = "harmonwig.*"
disallow_untyped_defs = true
disallow_incomplete_defs = true


[tool.ruff]
src = ["src"]

Expand All @@ -105,7 +99,6 @@ extend-select = [
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
Expand All @@ -116,22 +109,3 @@ ignore = [
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
]
isort.required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20"]
"noxfile.py" = ["T20"]


[tool.pylint]
py-version = "3.8"
ignore-paths = [".*/_version.py"]
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.disable = [
"design",
"fixme",
"line-too-long",
"missing-module-docstring",
"wrong-import-position",
]
2 changes: 0 additions & 2 deletions src/harmonwig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
harmonwig: Harmonic Wigner sampling from QM calculations.
"""


from __future__ import annotations

__version__ = "0.1.0"
Expand Down
Loading

0 comments on commit c51466e

Please sign in to comment.