Skip to content
Merged
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
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand All @@ -44,10 +44,6 @@ jobs:
tox-conda
cache-environment: true

- name: Install core dependencies.
shell: bash -l {0}
run: mamba install -c conda-forge tox-conda coverage mamba

# Unit, integration, and end-to-end tests.

- name: Run unit tests and doctests.
Expand Down
10 changes: 0 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ repos:
- id: python-no-log-warn
- id: python-use-type-annotations
- id: text-unicode-replacement-char
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.7
hooks:
Expand Down Expand Up @@ -55,12 +51,6 @@ repos:
types-setuptools
]
pass_filenames: false
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
args: [--no-build-isolation]
additional_dependencies: [setuptools-scm, wheel, toml]
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
releases are available on [PyPI](https://pypi.org/project/pytask-r) and
[Anaconda.org](https://anaconda.org/conda-forge/pytask-r).

## 0.4.1 - 2024-xx-xx

- {pull}`46` modernizes the package.

## 0.4.0 - 2023-10-08

- {pull}`42` makes the package compatible with pytask v0.4.0.
Expand Down
81 changes: 66 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,65 @@
[project]
name = "pytask_r"
description = "Run R scripts with pytask."
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: R",
]
requires-python = ">=3.8"
dependencies = ["click", "pluggy>=1.0.0", "pytask>=0.4.0"]
dynamic = ["version"]

[[project.authors]]
name = "Tobias Raabe"
email = "raabe@posteo.de"

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.license]
text = "MIT"

[project.urls]
Homepage = "https://github.com/pytask-dev/pytask-r"
Changelog = "https://github.com/pytask-dev/pytask-r/blob/main/CHANGES.md"
Documentation = "https://github.com/pytask-dev/pytask-r"
Github = "https://github.com/pytask-dev/pytask-r"
Tracker = "https://github.com/pytask-dev/pytask-r/issues"

[project.entry-points.pytask]
pytask_r = "pytask_r.plugin"

[project.optional-dependencies]
test = ["pytask-parallel", "pytest", "pytest-cov", "pytest-xdist", "pyyaml"]

[tool.rye]
managed = true

[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.vcs]
version-file = "src/pytask_r/_version.py"

[tool.hatch.build.targets.sdist]
exclude = ["tests"]
only-packages = true

[tool.hatch.build.targets.wheel]
exclude = ["tests"]
only-packages = true

[tool.hatch.version]
source = "vcs"

[tool.setuptools_scm]
write_to = "src/pytask_r/_version.py"
[tool.hatch.metadata]
allow-direct-references = true

[tool.mypy]
files = ["src", "tests"]
Expand All @@ -27,21 +83,16 @@ unsafe-fixes = true

[tool.ruff.lint]
extend-ignore = [
"S101", # raise errors for asserts.
"B905", # strict parameter for zip that was implemented in py310.
"ANN101", # type annotating self
"ANN102", # type annotating cls
"FBT", # flake8-boolean-trap
"EM", # flake8-errmsg
"ANN401", # flake8-annotate typing.Any
"PD", # pandas-vet
"COM812", # Comply with ruff-format
"ISC001", # Comply with ruff-format
"ANN101", # type annotating self
"ANN102", # type annotating cls
"ANN401",
"COM812", # Comply with ruff-format
"ISC001", # Comply with ruff-format
]
select = ["ALL"]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D", "ANN"]
"tests/*" = ["D", "ANN", "S101"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"
Expand Down
45 changes: 0 additions & 45 deletions setup.cfg

This file was deleted.

8 changes: 4 additions & 4 deletions src/pytask_r/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def pytask_execute_task_setup(task: PTask) -> None:
)
raise RuntimeError(msg)

assert len(marks) == 1
if len(marks) > 1:
msg = "Only one R marker is allowed per task."
raise ValueError(msg)

_, _, serializer, suffix = r(**marks[0].kwargs)
assert serializer
assert suffix
_, _, serializer, _ = r(**marks[0].kwargs)

serialized_node: PythonNode = task.depends_on["_serialized"] # type: ignore[assignment]
serialized_node.value.parent.mkdir(parents=True, exist_ok=True) # type: ignore[union-attr]
Expand Down
15 changes: 3 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,17 @@
envlist = pytest

[testenv]
# Cannot use package = editable, because tox-conda does not support tox v4.
usedevelop = true

[testenv:pytest]
[testenv:test]
extras = test
conda_channels =
conda-forge
conda-forge/label/pytask_rc
conda-forge/label/pytask_parallel_rc
nodefaults
conda_deps =
pytask >=0.4.0
pytask-parallel >=0.4.0

# Optional dependencies.
pyyaml
r-base >=4
r-jsonlite
r-yaml

pytest
pytest-cov
pytest-xdist
commands =
pytest {posargs}