Skip to content

Improve pins. #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 25, 2023
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
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- nodefaults

dependencies:
- python >=3.8,<3.12
- python >=3.8
- pip
- setuptools_scm
- toml
Expand Down
166 changes: 83 additions & 83 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,89 @@ requires = [
[tool.setuptools_scm]
write_to = "src/_pytask/_version.py"

[project]
name = "pytask"
description = "In its highest aspirations, pytask tries to be pytest as a build system."
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"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",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Build Tools",
]
dynamic = ["version"]
dependencies = [
"attrs>=21.3",
"click",
"click-default-group",
"networkx>=2.4",
"optree>=0.9",
"packaging",
"pluggy>=1",
"rich",
"sqlalchemy>=1.4.36",
'tomli>=1; python_version < "3.11"',
'typing-extensions; python_version < "3.9"',
]

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

[project.license]
text = "MIT"

[[project.authors]]
name = "Tobias Raabe"
email = "[email protected]"

[project.optional-dependencies]
docs = [
"furo",
"ipython",
"myst-parser",
"nbsphinx",
"sphinx",
"sphinx-click",
"sphinx-copybutton",
"sphinx-design>=0.3",
"sphinx-toolbox",
"sphinxext-opengraph",
]
[project.urls]
Changelog = "https://pytask-dev.readthedocs.io/en/stable/changes.html"
Documentation = "https://pytask-dev.readthedocs.io/en/stable"
Github = "https://github.com/pytask-dev/pytask"
Homepage = "https://pytask-dev.readthedocs.io/en/stable"
Tracker = "https://github.com/pytask-dev/pytask/issues"

[project.scripts]
pytask = "_pytask.cli:cli"

[tool.setuptools]
include-package-data = true
zip-safe = false
platforms = ["unix", "linux", "osx", "win32"]
license-files = ["LICENSE"]

[tool.setuptools.package-dir]
"" = "src"

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false

[tool.ruff]
target-version = "py38"
select = ["ALL"]
Expand Down Expand Up @@ -103,88 +186,5 @@ ignore-words-list = "falsy, hist, ines, unparseable"
[tool.refurb]
python_version = "3.8"

[project]
name = "pytask"
description = "In its highest aspirations, pytask tries to be pytest as a build system."
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"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",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Build Tools",
]
dynamic = ["version"]
dependencies = [
"attrs>=21.3",
"click",
"click-default-group",
"networkx>=2.4",
"optree>=0.9",
"packaging",
"pluggy>=1",
"rich",
"sqlalchemy>=1.4.36",
"tomli>=1",
"typing-extensions",
]

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

[project.license]
text = "MIT"

[[project.authors]]
name = "Tobias Raabe"
email = "[email protected]"

[project.optional-dependencies]
docs = [
"furo",
"ipython",
"myst-parser",
"nbsphinx",
"sphinx",
"sphinx-click",
"sphinx-copybutton",
"sphinx-design>=0.3",
"sphinx-toolbox",
"sphinxext-opengraph",
]
[project.urls]
Changelog = "https://pytask-dev.readthedocs.io/en/stable/changes.html"
Documentation = "https://pytask-dev.readthedocs.io/en/stable"
Github = "https://github.com/pytask-dev/pytask"
Homepage = "https://pytask-dev.readthedocs.io/en/stable"
Tracker = "https://github.com/pytask-dev/pytask/issues"

[project.scripts]
pytask = "_pytask.cli:cli"

[tool.setuptools]
include-package-data = true
zip-safe = false
platforms = ["unix", "linux", "osx", "win32"]
license-files = ["LICENSE"]

[tool.check-manifest]
ignore = ["src/_pytask/_version.py"]

[tool.setuptools.package-dir]
"" = "src"

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false
6 changes: 5 additions & 1 deletion src/_pytask/collect_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import itertools
import sys
import uuid
import warnings
from pathlib import Path
Expand Down Expand Up @@ -29,9 +30,12 @@
from _pytask.typing import ProductType
from attrs import define
from attrs import field
from typing_extensions import Annotated
from typing_extensions import get_origin

if sys.version_info >= (3, 9):
from typing import Annotated
else:
from typing_extensions import Annotated

if TYPE_CHECKING:
from _pytask.session import Session
Expand Down
13 changes: 9 additions & 4 deletions src/_pytask/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
from __future__ import annotations

import os
import sys
from pathlib import Path
from typing import Any

import click
import tomli
from _pytask.shared import parse_paths

if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib


def set_defaults_from_config(
context: click.Context, param: click.Parameter, value: Any # noqa: ARG001
Expand Down Expand Up @@ -85,7 +90,7 @@ def _find_project_root_and_config(paths: list[Path] | None) -> tuple[Path, Path
if path.exists():
try:
read_config(path)
except (tomli.TOMLDecodeError, OSError) as e:
except (tomllib.TOMLDecodeError, OSError) as e:
raise click.FileError(
filename=str(path), hint=f"Error reading {path}:\n{e}"
) from None
Expand Down Expand Up @@ -114,15 +119,15 @@ def read_config(

Raises
------
tomli.TOMLDecodeError
tomllib.TOMLDecodeError
Raised if ``*.toml`` could not be read.
KeyError
Raised if the specified sections do not exist.

"""
sections_ = sections.split(".")

config = tomli.loads(path.read_text(encoding="utf-8"))
config = tomllib.loads(path.read_text(encoding="utf-8"))

for section in sections_:
config = config[section]
Expand Down
2 changes: 1 addition & 1 deletion src/_pytask/task_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def task(

.. code-block:: python

from typing_extensions import Annotated
from typing import Annotated
from pytask import task

@task
Expand Down
11 changes: 0 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ deps =
pytest-xdist
coverage

# Package dependencies
attrs >=21.3.0
click
click-default-group
networkx >=2.4
pluggy
sqlalchemy >=1.4.36
optree >=0.9
rich
tomli >=1.0.0

# Optional and test dependencies
pexpect
linux, macos: pygraphviz
Expand Down