-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from afuetterer/7-development-setup
chore: refactor development setup
- Loading branch information
Showing
18 changed files
with
257 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
# run CI only if files in these whitelisted paths are changed | ||
paths: | ||
- '.github/workflows/**' | ||
- 'rdmo_plugins/**' | ||
- .pre-commit-config.yaml | ||
- pyproject.toml | ||
|
||
# Ref: https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHONDONTWRITEBYTECODE: 1 | ||
FORCE_COLOR: 1 # colored output by pytest etc. | ||
CLICOLOR_FORCE: 1 # colored output by ruff | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
cache: pip | ||
- run: python -m pip install --upgrade pip setuptools wheel | ||
- run: python -m pip install -e .[dev] | ||
- name: Set up pre-commit cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: lint-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Run linters via pre-commit (ruff, eslint) | ||
run: pre-commit run --all-files --color=always | ||
|
||
dev-setup: | ||
# Ref: structlog (MIT licensed) <https://github.com/hynek/structlog/blob/main/.github/workflows/ci.yml> | ||
name: "Test dev setup on ${{ matrix.os }}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
cache: pip | ||
- run: python -Im pip install -e .[dev] | ||
- run: python -Ic 'import rdmo_plugins; print(rdmo_plugins.__version__)' | ||
|
||
required-checks-pass: | ||
if: always() | ||
needs: | ||
- lint | ||
- dev-setup | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,6 @@ dist | |
*.egg-info | ||
|
||
/env | ||
|
||
.pytest_cache | ||
.ruff_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
repos: | ||
- repo: meta | ||
hooks: | ||
- id: check-hooks-apply | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
exclude: \.html$|\.txt$ | ||
- id: trailing-whitespace | ||
- id: debug-statements | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.6 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["setuptools", "wheel"] | ||
|
||
[project] | ||
name = "rdmo-plugins" | ||
description = "Import and export plugins for RDMO." | ||
readme = "README.md" | ||
keywords = [ | ||
"data management plan", | ||
"dmp", | ||
"rdmo", | ||
"research data", | ||
"research data management", | ||
] | ||
license = {text = "Apache-2.0"} | ||
authors = [ | ||
{name = "RDMO Arbeitsgemeinschaft", email = "[email protected]"}, | ||
] | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Web Environment", | ||
"Framework :: Django :: 4.2", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
dynamic = [ | ||
"version", | ||
] | ||
dependencies = [ | ||
"rdmo" | ||
] | ||
|
||
[project.optional-dependencies] | ||
ci = [ | ||
"rdmo-plugins[dev]", | ||
] | ||
dev = [ | ||
"pre-commit~=3.5", | ||
"rdmo[allauth]", | ||
"rdmo-plugins[pytest]", | ||
] | ||
|
||
[project.urls] | ||
documentation = "https://rdmo.readthedocs.io/en/latest/plugins/" | ||
homepage = "https://rdmorganiser.github.io" | ||
issues = "https://github.com/rdmorganiser/rdmo-plugins/issues" | ||
repository = "https://github.com/rdmorganiser/rdmo-plugins.git" | ||
slack = "https://rdmo.slack.com" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["rdmo_plugins*"] | ||
|
||
[tool.setuptools.package-data] | ||
"*" = ["*"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "rdmo_plugins.__version__"} | ||
|
||
[tool.ruff] | ||
target-version = "py38" | ||
line-length = 120 | ||
select = [ | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"E", # pycodestyle | ||
"F", # pyflakes | ||
"I", # isort | ||
"PGH", # pygrep-hooks | ||
"RUF", # ruff | ||
"UP", # pyupgrade | ||
"W", # pycodestyle | ||
"YTT", # flake8-2020 | ||
] | ||
ignore = [ | ||
"B006", # mutable-argument-default | ||
"B007", # unused-loop-control-variable | ||
"B018", # useless-expression | ||
"E501", # line-too-long | ||
"RUF012", # mutable-class-default | ||
] | ||
|
||
[tool.ruff.isort] | ||
known-first-party = ["rdmo_plugins"] | ||
section-order = [ | ||
"future", | ||
"standard-library", | ||
"pytest", | ||
"django", | ||
"rdmo", | ||
"third-party", | ||
"first-party", | ||
"local-folder" | ||
] | ||
|
||
[tool.ruff.isort.sections] | ||
pytest = ["pytest"] | ||
django = ["django"] | ||
rdmo = ["rdmo"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
__title__ = 'rdmo-plugins' | ||
__version__ = '1.0.0' | ||
__author__ = 'Jochen Klar' | ||
__email__ = '[email protected]' | ||
__license__ = 'Apache-2.0' | ||
__copyright__ = 'Copyright 2020 RDMO-Arbeitsgemeinschaft' | ||
|
||
VERSION = __version__ | ||
__version__ = "1.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.