Skip to content

Commit

Permalink
python310Packages.attrs: 22.2.0 -> 23.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
natsukium authored and Yt committed Aug 14, 2023
1 parent 9ce0053 commit f73e66b
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pkgs/development/python-modules/attrs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,31 @@
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptools
, hatchling
}:

buildPythonPackage rec {
pname = "attrs";
version = "22.2.0";
disabled = pythonOlder "3.6";
version = "23.1.0";
disabled = pythonOlder "3.7";
format = "pyproject";

src = fetchPypi {
inherit pname version;
hash = "sha256-ySJ7/C8BmTwD9o2zfR0VyWkBiDI8BnxkHxo1ylgYX5k=";
hash = "sha256-YnmDbVgVE6JvG/I1+azTM7yRFWg/FPfo+uRsmPxQ4BU=";
};

patches = [
# hatch-vcs and hatch-fancy-pypi-readme depend on pytest, which depends on attrs
./remove-hatch-plugins.patch
];

postPatch = ''
substituteAllInPlace pyproject.toml
'';

nativeBuildInputs = [
setuptools
hatchling
];

outputs = [
Expand Down Expand Up @@ -47,6 +56,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Python attributes without boilerplate";
homepage = "https:/python-attrs/attrs";
changelog = "https:/python-attrs/attrs/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ ];
};
Expand Down
74 changes: 74 additions & 0 deletions pkgs/development/python-modules/attrs/remove-hatch-plugins.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
diff --git a/pyproject.toml b/pyproject.toml
index fb8fae3..998211f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: MIT

[build-system]
-requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme"]
+requires = ["hatchling"]
build-backend = "hatchling.build"


@@ -26,7 +26,8 @@ classifiers = [
"Typing :: Typed",
]
dependencies = ["importlib_metadata;python_version<'3.8'"]
-dynamic = ["version", "readme"]
+dynamic = ["readme"]
+version = "@version@"

[project.optional-dependencies]
tests-no-zope = [
@@ -67,50 +68,9 @@ Changelog = "https://www.attrs.org/en/stable/changelog.html"
Funding = "https:/sponsors/hynek"
Tidelift = "https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=pypi"

-
-[tool.hatch.version]
-source = "vcs"
-raw-options = { local_scheme = "no-local-version" }
-
[tool.hatch.build.targets.wheel]
packages = ["src/attr", "src/attrs"]

-[tool.hatch.metadata.hooks.fancy-pypi-readme]
-content-type = "text/markdown"
-
-# PyPI doesn't support the <picture> tag.
-[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
-text = """<p align="center">
- <a href="https://www.attrs.org/">
- <img src="https://raw.githubusercontent.com/python-attrs/attrs/main/docs/_static/attrs_logo.svg" width="35%" alt="attrs" />
- </a>
-</p>
-"""
-
-[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
-path = "README.md"
-start-after = "<!-- teaser-begin -->"
-
-[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
-text = """
-
-## Release Information
-
-"""
-
-[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
-path = "CHANGELOG.md"
-pattern = "\n(###.+?\n)## "
-
-[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
-text = """
-
----
-
-[Full changelog](https://www.attrs.org/en/stable/changelog.html)
-"""
-
-
# Make coverage play nicely with pytest-xdist.
[tool.hatch.build.targets.wheel.hooks.autorun]
dependencies = ["hatch-autorun"]

0 comments on commit f73e66b

Please sign in to comment.