diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 223d7d7..848759d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,21 @@ on: jobs: + build-package: + name: Build & verify package + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: hynek/build-and-inspect-python-package@v2 + id: baipp + + outputs: + python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} + run-tests: name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }} diff --git a/.gitignore b/.gitignore index 1dc2b6d..65c4cc6 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ tests/test_jupyter/*.txt .mypy_cache .pytest_cache .ruff_cache +.venv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 986cb85..068d0a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -77,12 +77,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, toml, wheel] - repo: meta hooks: - id: check-hooks-apply diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..8531a3b --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12.2 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index b3ea241..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,12 +0,0 @@ -prune docs -prune tests - -exclude *.md -exclude *.yaml -exclude *.yml -exclude tox.ini - -include README.md -include LICENSE - -recursive-include src py.typed diff --git a/docs/source/changes.md b/docs/source/changes.md index 183b9e5..c7215bd 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -22,6 +22,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask-parallel) and - {pull}`99` changes that all tasks that are ready are being scheduled. It improves interactions with adaptive scaling. {issue}`98` does handle the resulting issues: no strong adherence to priorities, no pending status. +- {pull}`100` adds project management with rye. ## 0.4.1 - 2024-01-12 diff --git a/environment.yml b/environment.yml deleted file mode 100644 index a7ad075..0000000 --- a/environment.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: pytask-parallel - -channels: - - conda-forge - - nodefaults - -dependencies: - - python - - pip - - setuptools_scm - - toml - - # Package dependencies - - pytask>=0.4.5 - - cloudpickle - - loky - - optree - - # Additional dependencies - - universal_pathlib <0.2 - - s3fs>=2023.4.0 - - coiled - - distributed - - # Misc - - tox - - ipywidgets - - nbmake - - pytest-cov - - # Documentation - - furo - - myst-parser - - nbsphinx - - sphinx - - sphinx-click - - sphinx-copybutton - - sphinx-design >=0.3.0 - - sphinx-toolbox - - sphinxext-opengraph - - - pip: - - -e . diff --git a/pyproject.toml b/pyproject.toml index d28f4ea..501608d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,3 @@ -[build-system] -build-backend = "setuptools.build_meta" -requires = ["setuptools>=64", "setuptools_scm[toml]>=8"] - [project] name = "pytask_parallel" description = "Parallelize the execution of tasks with pytask." @@ -20,7 +16,7 @@ dependencies = [ "loky", "pluggy>=1.0.0", "pytask>=0.4.5", - "rich" + "rich", ] dynamic = ["version"] @@ -29,19 +25,20 @@ name = "Tobias Raabe" email = "raabe@posteo.de" [project.optional-dependencies] +coiled = ["coiled>=0.9.4"] dask = ["dask[complete]", "distributed"] docs = [ - "furo", - "ipython", - "matplotlib", - "myst-parser", - "nbsphinx", - "sphinx", - "sphinx-click", - "sphinx-copybutton", - "sphinx-design>=0.3", - "sphinx-toolbox", - "sphinxext-opengraph", + "furo", + "ipython", + "matplotlib", + "myst-parser", + "nbsphinx", + "sphinx", + "sphinx-click", + "sphinx-copybutton", + "sphinx-design>=0.3", + "sphinx-toolbox", + "sphinxext-opengraph", ] test = [ "pytask-parallel[all]", @@ -76,15 +73,36 @@ ignore = ["src/pytask_parallel/_version.py"] [project.entry-points.pytask] pytask_parallel = "pytask_parallel.plugin" -[tool.setuptools.package-dir] -"" = "src" +[build-system] +requires = ["hatchling", "hatch_vcs"] +build-backend = "hatchling.build" + +[tool.rye] +managed = true +dev-dependencies = [ + "s3fs>=2024.3.1", +] + +[tool.rye.scripts] +clean-docs = { cmd = "rm -rf docs/build" } +build-docs = { cmd = "sphinx-build -b html docs/source docs/build" } + +[tool.hatch.build.hooks.vcs] +version-file = "src/pytask_parallel/_version.py" + +[tool.hatch.build.targets.sdist] +exclude = ["tests"] +only-packages = true + +[tool.hatch.build.targets.wheel] +exclude = ["tests"] +only-packages = true -[tool.setuptools.packages.find] -where = ["src"] -namespaces = false +[tool.hatch.version] +source = "vcs" -[tool.setuptools_scm] -version_file = "src/pytask_parallel/_version.py" +[tool.hatch.metadata] +allow-direct-references = true [tool.mypy] files = ["src", "tests"] @@ -108,9 +126,7 @@ unsafe-fixes = true [tool.ruff.lint] extend-ignore = [ - # Others. "ANN101", # type annotating self - "ANN102", # type annotating cls "ANN401", # flake8-annotate typing.Any "COM812", # Comply with ruff-format. "ISC001", # Comply with ruff-format. @@ -120,6 +136,7 @@ select = ["ALL"] [tool.ruff.lint.per-file-ignores] "tests/*" = ["D", "ANN", "PLR2004", "S101"] "docs/source/conf.py" = ["INP001"] +"docs_src/*" = ["ARG001", "D", "INP001", "S301"] [tool.ruff.lint.isort] force-single-line = true diff --git a/requirements-dev.lock b/requirements-dev.lock new file mode 100644 index 0000000..70e3e4a --- /dev/null +++ b/requirements-dev.lock @@ -0,0 +1,86 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false + +-e file:. +aiobotocore==2.12.3 + # via s3fs +aiohttp==3.9.4 + # via aiobotocore + # via s3fs +aioitertools==0.11.0 + # via aiobotocore +aiosignal==1.3.1 + # via aiohttp +attrs==23.2.0 + # via aiohttp + # via pytask + # via pytask-parallel +botocore==1.34.69 + # via aiobotocore +click==8.1.7 + # via click-default-group + # via pytask + # via pytask-parallel +click-default-group==1.2.4 + # via pytask +cloudpickle==3.0.0 + # via loky + # via pytask-parallel +frozenlist==1.4.1 + # via aiohttp + # via aiosignal +fsspec==2024.3.1 + # via s3fs +greenlet==3.0.3 + # via sqlalchemy +idna==3.7 + # via yarl +jmespath==1.0.1 + # via botocore +loky==3.4.1 + # via pytask-parallel +markdown-it-py==3.0.0 + # via rich +mdurl==0.1.2 + # via markdown-it-py +multidict==6.0.5 + # via aiohttp + # via yarl +networkx==3.3 + # via pytask +optree==0.11.0 + # via pytask +packaging==24.0 + # via pytask +pluggy==1.4.0 + # via pytask + # via pytask-parallel +pygments==2.17.2 + # via rich +pytask==0.4.7 + # via pytask-parallel +python-dateutil==2.9.0.post0 + # via botocore +rich==13.7.1 + # via pytask + # via pytask-parallel +s3fs==2024.3.1 +six==1.16.0 + # via python-dateutil +sqlalchemy==2.0.29 + # via pytask +typing-extensions==4.11.0 + # via optree + # via sqlalchemy +urllib3==2.2.1 + # via botocore +wrapt==1.16.0 + # via aiobotocore +yarl==1.9.4 + # via aiohttp diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 0000000..4979697 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,51 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false + +-e file:. +attrs==23.2.0 + # via pytask + # via pytask-parallel +click==8.1.7 + # via click-default-group + # via pytask + # via pytask-parallel +click-default-group==1.2.4 + # via pytask +cloudpickle==3.0.0 + # via loky + # via pytask-parallel +greenlet==3.0.3 + # via sqlalchemy +loky==3.4.1 + # via pytask-parallel +markdown-it-py==3.0.0 + # via rich +mdurl==0.1.2 + # via markdown-it-py +networkx==3.3 + # via pytask +optree==0.11.0 + # via pytask +packaging==24.0 + # via pytask +pluggy==1.4.0 + # via pytask + # via pytask-parallel +pygments==2.17.2 + # via rich +pytask==0.4.7 + # via pytask-parallel +rich==13.7.1 + # via pytask + # via pytask-parallel +sqlalchemy==2.0.29 + # via pytask +typing-extensions==4.11.0 + # via optree + # via sqlalchemy