Skip to content

Commit

Permalink
Merge pull request #21 from ocefpaf/pyproject.toml_only
Browse files Browse the repository at this point in the history
Pyproject.toml only
  • Loading branch information
ocefpaf authored Feb 27, 2023
2 parents 5d19016 + 7761a22 commit cd492b8
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 113 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "Bot"
18 changes: 10 additions & 8 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Build and Deploy docs
name: Documentation

on:
pull_request:
push:
branches: [main]
branches:
- main
release:
types:
- published

jobs:
build-docs:
Expand All @@ -15,7 +20,7 @@ jobs:
fetch-depth: 0

- name: Setup Mamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: false

Expand All @@ -26,10 +31,6 @@ jobs:
micromamba activate TEST
python -m pip install -e . --no-deps --force-reinstall
- name: Get the version
id: get_version
run: echo "VERSION=$(python setup.py --version)" >> $GITHUB_OUTPUT

- name: Build documentation
shell: bash -l {0}
run: |
Expand All @@ -42,7 +43,8 @@ jobs:
popd
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.6.1
if: success() && github.event_name == 'release'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
10 changes: 6 additions & 4 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: Publish to PyPI
on:
pull_request:
push:
branches: [main]
branches:
- main
release:
types: [published]
types:
- published

jobs:
packages:
Expand All @@ -14,7 +16,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.x"

Expand All @@ -38,7 +40,7 @@ jobs:

- name: Test wheels
run: |
cd dist && python -m pip install ioos_pkg_skeleton*.whl
cd dist && python -m pip install *.whl
python -m twine check *
shell: bash

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false

Expand All @@ -20,7 +20,7 @@ jobs:
fetch-depth: 0

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: false

Expand Down
37 changes: 13 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: tests/data
Expand All @@ -22,45 +22,34 @@ repos:
args: [--config=pyproject.toml]

- repo: https://github.com/keewis/blackdoc
rev: v0.3.4
rev: v0.3.8
hooks:
- id: blackdoc

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.252
hooks:
- id: flake8
exclude: docs/source/conf.py
args: [--max-line-length=105]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
additional_dependencies: [toml]
args: ["--profile", "black", "--filter-files"]
- id: ruff

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.2
hooks:
- id: codespell
args:
- --quiet-level=2

- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
- id: pyupgrade
args:
- --py36-plus

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.3
rev: v2.4.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.9.1"
hooks:
- id: pyproject-fmt
8 changes: 7 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, "ioos_pkg_skeleton", "ioos_pkg_skeleton Documentation", [author], 1),
(
master_doc,
"ioos_pkg_skeleton",
"ioos_pkg_skeleton Documentation",
[author],
1,
),
]


Expand Down
5 changes: 4 additions & 1 deletion ioos_pkg_skeleton/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
ioos_pkg_skeleton is not a real package, just a set of best practices examples.
"""

from ioos_pkg_skeleton.ioos_pkg_skeleton import meaning_of_life, meaning_of_life_url
from ioos_pkg_skeleton.ioos_pkg_skeleton import (
meaning_of_life,
meaning_of_life_url,
)

__all__ = [
"meaning_of_life",
Expand Down
2 changes: 1 addition & 1 deletion ioos_pkg_skeleton/ioos_pkg_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def meaning_of_life_url() -> str:
"""
Fetch the meaning of life from https://en.wikipedia.org/wiki/Main_Page.
"""
url = "https://en.wikipedia.org/api/rest_v1/page/summary/Monty_Python's_The_Meaning_of_Life"
url = "https://en.wikipedia.org/api/rest_v1/page/summary/Monty_Python's_The_Meaning_of_Life" # noqa
r = requests.get(url)
r.raise_for_status()
j = r.json()
Expand Down
48 changes: 47 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=42",
"setuptools_scm[toml]>=3.4",
"wheel",
]

[project]
name = "ioos-pkg-skeleton"
description = "MY AWESOME MODULE"
readme = "README.md"
license = {file = "LICENSE.txt"}
authors = [
{name = "AUTHOR NAME", email = "AUTHOR@EMAIL.COM"},
]
requires-python = ">=3.6"
dynamic = [
"version",
]
dependencies = [
"numpy",
"requests",
]
[project.urls]
documentation = "https://ioos.github.io/ioos-python-package-skeleton"
homepage = "https://github.com/ioos/ioos-python-package-skeleton"
repository = "https://github.com/ioos/ioos-python-package-skeleton"

[tool.setuptools]
packages = ["ioos_pkg_skeleton"]
zip-safe = false
include-package-data = true

[tool.setuptools_scm]
write_to = "ioos_pkg_skeleton/_version.py"
write_to_template = "__version__ = '{version}'"

[tool.ruff]
select = [
"F", # flakes
"I", # import sorting
"U", # upgrade
]
target-version = "py311"
line-length = 79

[tool.ruff.per-file-ignores]
"docs/conf.py" = ["E402"]

[tool.interrogate]
ignore-init-method = true
Expand Down
10 changes: 1 addition & 9 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
black
check-manifest
doctr
flake8
flake8-builtins
flake8-comprehensions
flake8-mutable
flake8-print
interrogate
isort
jupyter
myst-parser
nbsphinx
pre-commit
pylint
pytest
pytest-cov
pytest-flake8
pytest-xdist
setuptools_scm
sphinx
Expand Down
50 changes: 0 additions & 50 deletions setup.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions setup.py

This file was deleted.

0 comments on commit cd492b8

Please sign in to comment.