diff options
author | Maciej Barć <xgqt@gentoo.org> | 2023-01-27 14:00:37 +0100 |
---|---|---|
committer | Maciej Barć <xgqt@gentoo.org> | 2023-01-27 14:02:00 +0100 |
commit | d872b68a2c277eccdce24ab6fbd92882f88e02f5 (patch) | |
tree | 56e7a2d20d90db0d90de523c334d6ec51845dfd4 /sci-mathematics | |
parent | sci-mathematics/mathlib-tools: drop old 1.3.1 (diff) | |
download | gentoo-d872b68a2c277eccdce24ab6fbd92882f88e02f5.tar.gz gentoo-d872b68a2c277eccdce24ab6fbd92882f88e02f5.tar.bz2 gentoo-d872b68a2c277eccdce24ab6fbd92882f88e02f5.zip |
sci-mathematics/mathlib-tools: patch to use tomli(-w)
Closes: https://bugs.gentoo.org/878681
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Diffstat (limited to 'sci-mathematics')
-rw-r--r-- | sci-mathematics/mathlib-tools/Manifest | 2 | ||||
-rw-r--r-- | sci-mathematics/mathlib-tools/files/mathlib-tools-1.3.2-pull-131.patch | 84 | ||||
-rw-r--r-- | sci-mathematics/mathlib-tools/mathlib-tools-1.3.2_p1.ebuild (renamed from sci-mathematics/mathlib-tools/mathlib-tools-1.3.2.ebuild) | 13 |
3 files changed, 93 insertions, 6 deletions
diff --git a/sci-mathematics/mathlib-tools/Manifest b/sci-mathematics/mathlib-tools/Manifest index 0b095783fe60..cba80086497b 100644 --- a/sci-mathematics/mathlib-tools/Manifest +++ b/sci-mathematics/mathlib-tools/Manifest @@ -1 +1 @@ -DIST mathlib-tools-1.3.2.tar.gz 34918 BLAKE2B 4d54922cfe5de3d6671161081c49fe82568ad90795ece8ad43e9f62c75415204e62ff1822be213ab259371e82ea869ff63195056cc415a1f376fa0a4a438fb4f SHA512 250390e55170e5a7520f34dee27c9846351a64c4157e9f4a0ec1d0d9bf6b075b09187476375a90e7df2fdab6ce7b7b51ff03f1bf28007915242811f377ce3150 +DIST mathlib-tools-1.3.2_p1.gh.tar.gz 36686 BLAKE2B 0120e64821c183e368a4ca7d7122146637b933c9f56279c15716c825ac6e0e20d19f8ece731ee5c4114b7c221e84b53d3b89fcc0268529cbd1f2ad3328ac7847 SHA512 7b3c5a8aea19a4c7df366c71baa19e3d8ab6a0a6b387973ed37aecf3003361f298b85a4deecc8a4fcb6a2003f666c503fd66cde986e412003d439d48345afbc7 diff --git a/sci-mathematics/mathlib-tools/files/mathlib-tools-1.3.2-pull-131.patch b/sci-mathematics/mathlib-tools/files/mathlib-tools-1.3.2-pull-131.patch new file mode 100644 index 000000000000..2debd3d6b396 --- /dev/null +++ b/sci-mathematics/mathlib-tools/files/mathlib-tools-1.3.2-pull-131.patch @@ -0,0 +1,84 @@ +--- a/mathlibtools/lib.py ++++ b/mathlibtools/lib.py +@@ -21,7 +21,8 @@ + + import requests + from tqdm import tqdm # type: ignore +-import toml ++import tomli ++import tomli_w + import yaml + from git import (Repo, Commit, InvalidGitRepositoryError, # type: ignore + GitCommandError, BadName, RemoteReference) # type: ignore +@@ -84,7 +85,7 @@ def mathlib_lean_version() -> VersionTuple: + """Return the latest Lean release supported by mathlib""" + resp = requests.get("https://raw.githubusercontent.com/leanprover-community/mathlib/master/leanpkg.toml") + assert resp.status_code == 200 +- conf = toml.loads(resp.text) ++ conf = tomli.loads(resp.text) + return parse_version(conf['package']['lean_version']) + + def set_download_url(url: str = AZURE_URL) -> None: +@@ -441,7 +442,8 @@ def from_path(cls, path: Path, cache_url: str = '', + except ValueError: + rev = '' + directory = find_root(path) +- config = toml.load(directory/'leanpkg.toml') ++ with (directory/'leanpkg.toml').open('rb') as pkgtoml: ++ config = tomli.load(pkgtoml) + + return cls(repo, is_dirty, rev, directory, + config['package'], config['dependencies'], +@@ -456,7 +458,8 @@ def user_wide(cls, cache_url: str = '', + version of Lean supported by mathlib.""" + directory = Path.home()/'.lean' + try: +- config = toml.load(directory/'leanpkg.toml') ++ with (directory/'leanpkg.toml').open('rb') as pkgtoml: ++ config = tomli.load(pkgtoml) + except FileNotFoundError: + directory.mkdir(exist_ok=True) + version = mathlib_lean_version() +@@ -469,8 +472,8 @@ def user_wide(cls, cache_url: str = '', + pkg = { 'name': '_user_local_packages', + 'version': '1', + 'lean_version': version_str } +- with (directory/'leanpkg.toml').open('w') as pkgtoml: +- toml.dump({'package': pkg}, pkgtoml) ++ with (directory/'leanpkg.toml').open('wb') as pkgtoml: ++ tomli_w.dump({'package': pkg}, pkgtoml) + config = { 'package': pkg, 'dependencies': dict() } + + return cls(None, False, '', directory, +@@ -534,7 +537,8 @@ def mathlib_repo(self) -> Repo: + + def read_config(self) -> None: + try: +- config = toml.load(self.directory/'leanpkg.toml') ++ with (self.directory/'leanpkg.toml').open('rb') as pkgtoml: ++ config = tomli.load(pkgtoml) + except FileNotFoundError: + raise InvalidLeanProject('Missing leanpkg.toml') + +@@ -551,7 +555,7 @@ def write_config(self) -> None: + # for dependencies. + with (self.directory/'leanpkg.toml').open('w') as cfg: + cfg.write('[package]\n') +- cfg.write(toml.dumps(self.pkg_config)) ++ cfg.write(tomli_w.dumps(self.pkg_config)) + cfg.write('\n[dependencies]\n') + for dep, val in self.deps.items(): + nval = str(val).replace("'git':", 'git =').replace( + +--- a/setup.py ++++ b/setup.py +@@ -28,7 +28,7 @@ + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent" ], + python_requires='>=3.6', +- install_requires=['toml>=0.10.0', 'PyGithub', 'certifi', 'gitpython>=2.1.11', 'requests', ++ install_requires=['tomli', 'tomli-w', 'PyGithub', 'certifi', 'gitpython>=2.1.11', 'requests', + 'Click', 'tqdm', 'networkx', 'pydot', + 'PyYAML>=3.13', 'atomicwrites', "dataclasses; python_version=='3.6'"] + ) + diff --git a/sci-mathematics/mathlib-tools/mathlib-tools-1.3.2.ebuild b/sci-mathematics/mathlib-tools/mathlib-tools-1.3.2_p1.ebuild index b97ef8a242c6..812a7aaeeb5b 100644 --- a/sci-mathematics/mathlib-tools/mathlib-tools-1.3.2.ebuild +++ b/sci-mathematics/mathlib-tools/mathlib-tools-1.3.2_p1.ebuild @@ -15,10 +15,10 @@ if [[ ${PV} == *9999* ]] ; then inherit git-r3 EGIT_REPO_URI="https://github.com/leanprover-community/${PN}.git" else - H=1ce2e7143b2456867f4a671a078a4e9af3c73c11 - SRC_URI="https://github.com/leanprover-community/${PN}/archive/${H}.tar.gz - -> ${P}.tar.gz" - S="${WORKDIR}"/${PN}-${H} + _PV=${PV/_p1/} + SRC_URI="https://github.com/leanprover-community/${PN}/archive/v${_PV}.tar.gz + -> ${P}.gh.tar.gz" + S="${WORKDIR}"/${PN}-${_PV} KEYWORDS="~amd64 ~x86" fi @@ -27,7 +27,6 @@ SLOT="0" BDEPEND=" >=dev-python/GitPython-2.1.11[${PYTHON_USEDEP}] - >=dev-python/toml-0.10.0[${PYTHON_USEDEP}] dev-python/PyGithub[${PYTHON_USEDEP}] dev-python/atomicwrites[${PYTHON_USEDEP}] dev-python/certifi[${PYTHON_USEDEP}] @@ -36,6 +35,8 @@ BDEPEND=" dev-python/pydot[${PYTHON_USEDEP}] dev-python/pyyaml[${PYTHON_USEDEP}] dev-python/requests[${PYTHON_USEDEP}] + dev-python/tomli-w[${PYTHON_USEDEP}] + dev-python/tomli[${PYTHON_USEDEP}] dev-python/tqdm[${PYTHON_USEDEP}] " RDEPEND=" @@ -43,6 +44,8 @@ RDEPEND=" sci-mathematics/lean:0/3 " +PATCHES=( "${FILESDIR}"/${PN}-1.3.2-pull-131.patch ) + distutils_enable_tests pytest src_prepare() { |