feu 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {feu-0.3.2 → feu-0.3.3}/PKG-INFO +16 -13
- {feu-0.3.2 → feu-0.3.3}/README.md +12 -11
- {feu-0.3.2 → feu-0.3.3}/pyproject.toml +10 -10
- {feu-0.3.2 → feu-0.3.3}/src/feu/__main__.py +8 -1
- feu-0.3.3/src/feu/git.py +91 -0
- {feu-0.3.2 → feu-0.3.3}/src/feu/imports.py +58 -3
- {feu-0.3.2 → feu-0.3.3}/src/feu/package.py +1 -0
- {feu-0.3.2 → feu-0.3.3}/src/feu/testing.py +3 -1
- {feu-0.3.2 → feu-0.3.3}/LICENSE +0 -0
- {feu-0.3.2 → feu-0.3.3}/src/feu/__init__.py +0 -0
- {feu-0.3.2 → feu-0.3.3}/src/feu/install.py +0 -0
- {feu-0.3.2 → feu-0.3.3}/src/feu/version.py +0 -0
{feu-0.3.2 → feu-0.3.3}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: feu
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: A light library to help to manage packages
|
|
5
5
|
License: BSD-3-Clause
|
|
6
6
|
Keywords: package,install,dependency
|
|
@@ -23,8 +23,10 @@ Classifier: Topic :: Scientific/Engineering
|
|
|
23
23
|
Classifier: Topic :: Software Development :: Libraries
|
|
24
24
|
Provides-Extra: all
|
|
25
25
|
Provides-Extra: cli
|
|
26
|
+
Provides-Extra: git
|
|
26
27
|
Requires-Dist: click (>=8.1,<9.0) ; extra == "all" or extra == "cli"
|
|
27
|
-
Requires-Dist:
|
|
28
|
+
Requires-Dist: gitpython (>=3.1.41,<4.0) ; extra == "git"
|
|
29
|
+
Requires-Dist: packaging (>=21.0,<26.0)
|
|
28
30
|
Project-URL: Homepage, https://github.com/durandtibo/feu
|
|
29
31
|
Project-URL: Repository, https://github.com/durandtibo/feu
|
|
30
32
|
Description-Content-Type: text/markdown
|
|
@@ -123,17 +125,18 @@ Please check the [get started page](https://durandtibo.github.io/feu/get_started
|
|
|
123
125
|
install only some specific dependencies or other alternatives to install the library.
|
|
124
126
|
The following is the corresponding `feu` versions and supported dependencies.
|
|
125
127
|
|
|
126
|
-
| `feu` | `packaging` | `python` | `click`<sup>*</sup> |
|
|
127
|
-
|
|
128
|
-
| `main` | `>=21.0,<
|
|
129
|
-
| `0.3.
|
|
130
|
-
| `0.3.
|
|
131
|
-
| `0.3.
|
|
132
|
-
| `0.
|
|
133
|
-
| `0.2.
|
|
134
|
-
| `0.2.
|
|
135
|
-
| `0.2.
|
|
136
|
-
| `0.2.
|
|
128
|
+
| `feu` | `packaging` | `python` | `click`<sup>*</sup> | `gitpython`<sup>*</sup> |
|
|
129
|
+
|---------|----------------|---------------|---------------------|-------------------------|
|
|
130
|
+
| `main` | `>=21.0,<26.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | `>=3.1.41,<4.0` |
|
|
131
|
+
| `0.3.3` | `>=21.0,<26.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | `>=3.1.41,<4.0` |
|
|
132
|
+
| `0.3.2` | `>=21.0,<25.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | |
|
|
133
|
+
| `0.3.1` | `>=21.0,<25.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | |
|
|
134
|
+
| `0.3.0` | `>=21.0,<25.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | |
|
|
135
|
+
| `0.2.4` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
136
|
+
| `0.2.3` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
137
|
+
| `0.2.2` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
138
|
+
| `0.2.1` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
139
|
+
| `0.2.0` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
137
140
|
|
|
138
141
|
<sup>*</sup> indicates an optional dependency
|
|
139
142
|
|
|
@@ -92,17 +92,18 @@ Please check the [get started page](https://durandtibo.github.io/feu/get_started
|
|
|
92
92
|
install only some specific dependencies or other alternatives to install the library.
|
|
93
93
|
The following is the corresponding `feu` versions and supported dependencies.
|
|
94
94
|
|
|
95
|
-
| `feu` | `packaging` | `python` | `click`<sup>*</sup> |
|
|
96
|
-
|
|
97
|
-
| `main` | `>=21.0,<
|
|
98
|
-
| `0.3.
|
|
99
|
-
| `0.3.
|
|
100
|
-
| `0.3.
|
|
101
|
-
| `0.
|
|
102
|
-
| `0.2.
|
|
103
|
-
| `0.2.
|
|
104
|
-
| `0.2.
|
|
105
|
-
| `0.2.
|
|
95
|
+
| `feu` | `packaging` | `python` | `click`<sup>*</sup> | `gitpython`<sup>*</sup> |
|
|
96
|
+
|---------|----------------|---------------|---------------------|-------------------------|
|
|
97
|
+
| `main` | `>=21.0,<26.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | `>=3.1.41,<4.0` |
|
|
98
|
+
| `0.3.3` | `>=21.0,<26.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | `>=3.1.41,<4.0` |
|
|
99
|
+
| `0.3.2` | `>=21.0,<25.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | |
|
|
100
|
+
| `0.3.1` | `>=21.0,<25.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | |
|
|
101
|
+
| `0.3.0` | `>=21.0,<25.0` | `>=3.9,<3.14` | `>=8.1,<9.0` | |
|
|
102
|
+
| `0.2.4` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
103
|
+
| `0.2.3` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
104
|
+
| `0.2.2` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
105
|
+
| `0.2.1` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
106
|
+
| `0.2.0` | `>=21.0,<25.0` | `>=3.9,<3.13` | `>=8.1,<9.0` | |
|
|
106
107
|
|
|
107
108
|
<sup>*</sup> indicates an optional dependency
|
|
108
109
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "feu"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.3"
|
|
4
4
|
description = "A light library to help to manage packages"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = ["Thibaut Durand <durand.tibo+gh@gmail.com>"]
|
|
@@ -32,14 +32,16 @@ packages = [
|
|
|
32
32
|
[tool.poetry.dependencies]
|
|
33
33
|
# Core dependencies
|
|
34
34
|
python = ">=3.9,<3.14"
|
|
35
|
-
packaging = ">=21.0,<
|
|
35
|
+
packaging = ">=21.0,<26.0"
|
|
36
36
|
|
|
37
37
|
# Optional dependencies
|
|
38
38
|
click = { version = ">=8.1,<9.0", optional = true }
|
|
39
|
+
gitpython = { version = ">=3.1.41,<4.0", optional = true }
|
|
39
40
|
|
|
40
41
|
[tool.poetry.extras]
|
|
41
|
-
all = ["click"]
|
|
42
|
+
all = ["click", "git"]
|
|
42
43
|
cli = ["click"]
|
|
44
|
+
git = ["gitpython"]
|
|
43
45
|
|
|
44
46
|
[tool.poetry.group.docs]
|
|
45
47
|
optional = true
|
|
@@ -47,18 +49,18 @@ optional = true
|
|
|
47
49
|
[tool.poetry.group.docs.dependencies]
|
|
48
50
|
mike = "^2.1"
|
|
49
51
|
mkdocs-material = "^9.5"
|
|
50
|
-
mkdocstrings = { extras = ["python"], version = ">=0.
|
|
52
|
+
mkdocstrings = { extras = ["python"], version = ">=0.29,<1.0" }
|
|
51
53
|
|
|
52
54
|
[tool.poetry.group.dev.dependencies]
|
|
53
55
|
black = ">=25.1"
|
|
54
|
-
coverage = { extras = ["toml"], version = "^7.
|
|
56
|
+
coverage = { extras = ["toml"], version = "^7.8" }
|
|
55
57
|
docformatter = { extras = ["tomli"], version = "^1.7" }
|
|
56
|
-
pre-commit = "^4.
|
|
58
|
+
pre-commit = "^4.2"
|
|
57
59
|
pygments = "^2.19"
|
|
58
60
|
pytest = "^8.3"
|
|
59
|
-
pytest-cov = ">=
|
|
61
|
+
pytest-cov = ">=6,<7"
|
|
60
62
|
pytest-timeout = "^2.3"
|
|
61
|
-
ruff = ">=0.
|
|
63
|
+
ruff = ">=0.11,<1.0"
|
|
62
64
|
xdoctest = "^1.2"
|
|
63
65
|
|
|
64
66
|
[build-system]
|
|
@@ -152,8 +154,6 @@ lint.select = [
|
|
|
152
154
|
]
|
|
153
155
|
lint.ignore = [
|
|
154
156
|
"A003", # Class attribute `{name}` is shadowing a python builtin
|
|
155
|
-
"ANN101", # Missing type annotation for `self` in method
|
|
156
|
-
"ANN102", # Missing type annotation for `cls` in classmethod
|
|
157
157
|
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed.
|
|
158
158
|
"B905", # `zip()` without an explicit strict= parameter set. The `strict=` argument was added in Python 3.10
|
|
159
159
|
"E501", # Line lengths are recommended to be no greater than 79 characters.
|
|
@@ -2,6 +2,8 @@ r"""Contain the main entry point."""
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import sys
|
|
6
|
+
|
|
5
7
|
from feu.imports import is_click_available
|
|
6
8
|
from feu.install import install_package
|
|
7
9
|
from feu.package import find_closest_version as find_closest_version_
|
|
@@ -30,7 +32,12 @@ def install(pkg_name: str, pkg_version: str) -> None:
|
|
|
30
32
|
|
|
31
33
|
python -m feu install --pkg_name=numpy --pkg_version=2.0.2
|
|
32
34
|
"""
|
|
33
|
-
|
|
35
|
+
version = find_closest_version_(
|
|
36
|
+
pkg_name=pkg_name,
|
|
37
|
+
pkg_version=pkg_version,
|
|
38
|
+
python_version=f"{sys.version_info[0]}.{sys.version_info[1]}",
|
|
39
|
+
)
|
|
40
|
+
install_package(package=pkg_name, version=version)
|
|
34
41
|
|
|
35
42
|
|
|
36
43
|
@click.command()
|
feu-0.3.3/src/feu/git.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
r"""Contain git utility functions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = ["get_last_tag_name", "get_last_version_tag_name", "get_tags"]
|
|
6
|
+
|
|
7
|
+
from contextlib import suppress
|
|
8
|
+
from unittest.mock import Mock
|
|
9
|
+
|
|
10
|
+
from packaging.version import InvalidVersion, Version
|
|
11
|
+
|
|
12
|
+
from feu.imports import check_git, is_git_available
|
|
13
|
+
|
|
14
|
+
if is_git_available():
|
|
15
|
+
import git
|
|
16
|
+
else: # pragma: no cover
|
|
17
|
+
git = Mock()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_tags() -> list[git.TagReference]:
|
|
21
|
+
r"""Get the list of git tags sorted by date/time for the current
|
|
22
|
+
repository.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
The list of git tags sorted by date/time.
|
|
26
|
+
|
|
27
|
+
Example usage:
|
|
28
|
+
|
|
29
|
+
```pycon
|
|
30
|
+
|
|
31
|
+
>>> from feu.git import get_tags
|
|
32
|
+
>>> tags = get_tags()
|
|
33
|
+
>>> tags
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
"""
|
|
37
|
+
check_git()
|
|
38
|
+
repo = git.Repo(search_parent_directories=True)
|
|
39
|
+
return sorted(repo.tags, key=lambda t: t.commit.committed_datetime)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def get_last_tag_name() -> str:
|
|
43
|
+
r"""Get the name of the most recent tag in the current repository.
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
The tag name.
|
|
47
|
+
|
|
48
|
+
Example usage:
|
|
49
|
+
|
|
50
|
+
```pycon
|
|
51
|
+
|
|
52
|
+
>>> from feu.git import get_last_tag_name
|
|
53
|
+
>>> tag = get_last_tag_name()
|
|
54
|
+
>>> tag
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
"""
|
|
58
|
+
tags = get_tags()
|
|
59
|
+
if not tags:
|
|
60
|
+
msg = "No tag was found"
|
|
61
|
+
raise RuntimeError(msg)
|
|
62
|
+
return tags[-1].name
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def get_last_version_tag_name() -> str:
|
|
66
|
+
r"""Get the name of the most recent version tag in the current
|
|
67
|
+
repository.
|
|
68
|
+
|
|
69
|
+
A version tag is a tag starting with ``v{number}*``.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
The tag name.
|
|
73
|
+
|
|
74
|
+
Example usage:
|
|
75
|
+
|
|
76
|
+
```pycon
|
|
77
|
+
|
|
78
|
+
>>> from feu.git import get_last_version_tag_name
|
|
79
|
+
>>> tag = get_last_version_tag_name()
|
|
80
|
+
>>> tag
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
"""
|
|
84
|
+
tags = get_tags()
|
|
85
|
+
for tag in tags[::-1]:
|
|
86
|
+
with suppress(InvalidVersion):
|
|
87
|
+
Version(tag.name)
|
|
88
|
+
return tag.name
|
|
89
|
+
|
|
90
|
+
msg = "No tag was found"
|
|
91
|
+
raise RuntimeError(msg)
|
|
@@ -2,7 +2,14 @@ r"""Contain to check if a package or module is available."""
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
__all__ = [
|
|
5
|
+
__all__ = [
|
|
6
|
+
"check_click",
|
|
7
|
+
"check_git",
|
|
8
|
+
"is_click_available",
|
|
9
|
+
"is_git_available",
|
|
10
|
+
"is_module_available",
|
|
11
|
+
"is_package_available",
|
|
12
|
+
]
|
|
6
13
|
|
|
7
14
|
from contextlib import suppress
|
|
8
15
|
from functools import lru_cache
|
|
@@ -15,7 +22,7 @@ def is_package_available(package: str) -> bool:
|
|
|
15
22
|
"""Check if a package is available.
|
|
16
23
|
|
|
17
24
|
Args:
|
|
18
|
-
package:
|
|
25
|
+
package: The package name to check.
|
|
19
26
|
|
|
20
27
|
Returns:
|
|
21
28
|
``True`` if the package is available, otherwise ``False``.
|
|
@@ -44,7 +51,7 @@ def is_module_available(module: str) -> bool:
|
|
|
44
51
|
"""Check if a module path is available.
|
|
45
52
|
|
|
46
53
|
Args:
|
|
47
|
-
module:
|
|
54
|
+
module: The module to check.
|
|
48
55
|
|
|
49
56
|
Example usage:
|
|
50
57
|
|
|
@@ -115,3 +122,51 @@ def check_click() -> None:
|
|
|
115
122
|
"pip install click\n"
|
|
116
123
|
)
|
|
117
124
|
raise RuntimeError(msg)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
###############
|
|
128
|
+
# git #
|
|
129
|
+
###############
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
@lru_cache
|
|
133
|
+
def is_git_available() -> bool:
|
|
134
|
+
r"""Indicate if the ``git`` package is installed or not.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
``True`` if ``git`` is available otherwise ``False``.
|
|
138
|
+
|
|
139
|
+
Example usage:
|
|
140
|
+
|
|
141
|
+
```pycon
|
|
142
|
+
|
|
143
|
+
>>> from feu.imports import is_git_available
|
|
144
|
+
>>> is_git_available()
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
"""
|
|
148
|
+
return is_package_available("git")
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def check_git() -> None:
|
|
152
|
+
r"""Check if the ``git`` package is installed.
|
|
153
|
+
|
|
154
|
+
Raises:
|
|
155
|
+
RuntimeError: if the ``git`` package is not installed.
|
|
156
|
+
|
|
157
|
+
Example usage:
|
|
158
|
+
|
|
159
|
+
```pycon
|
|
160
|
+
|
|
161
|
+
>>> from feu.imports import check_git
|
|
162
|
+
>>> check_git()
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
"""
|
|
166
|
+
if not is_git_available():
|
|
167
|
+
msg = (
|
|
168
|
+
"'git' package is required but not installed. "
|
|
169
|
+
"You can install 'git' package with the command:\n\n"
|
|
170
|
+
"pip install gitpython\n"
|
|
171
|
+
)
|
|
172
|
+
raise RuntimeError(msg)
|
|
@@ -58,6 +58,7 @@ class PackageConfig:
|
|
|
58
58
|
},
|
|
59
59
|
# https://github.com/scikit-learn/scikit-learn/releases
|
|
60
60
|
"scikit-learn": {
|
|
61
|
+
"3.13": {"min": "1.6.0", "max": None},
|
|
61
62
|
"3.12": {"min": "1.3.1", "max": None},
|
|
62
63
|
"3.11": {"min": "1.2.0", "max": None},
|
|
63
64
|
"3.10": {"min": "1.1.0", "max": None},
|
|
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
__all__ = [
|
|
6
6
|
"click_available",
|
|
7
|
+
"git_available",
|
|
7
8
|
"jax_available",
|
|
8
9
|
"numpy_available",
|
|
9
10
|
"pandas_available",
|
|
@@ -18,9 +19,10 @@ __all__ = [
|
|
|
18
19
|
|
|
19
20
|
import pytest
|
|
20
21
|
|
|
21
|
-
from feu.imports import is_click_available, is_package_available
|
|
22
|
+
from feu.imports import is_click_available, is_git_available, is_package_available
|
|
22
23
|
|
|
23
24
|
click_available = pytest.mark.skipif(not is_click_available(), reason="Requires click")
|
|
25
|
+
git_available = pytest.mark.skipif(not is_git_available(), reason="Requires git")
|
|
24
26
|
jax_available = pytest.mark.skipif(not is_package_available("jax"), reason="Requires JAX")
|
|
25
27
|
numpy_available = pytest.mark.skipif(not is_package_available("numpy"), reason="Requires NumPy")
|
|
26
28
|
pandas_available = pytest.mark.skipif(not is_package_available("pandas"), reason="Requires pandas")
|
{feu-0.3.2 → feu-0.3.3}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|