python-package-folder 4.1.3__tar.gz → 4.3.0__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.
- python_package_folder-4.3.0/MANIFEST.in +2 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/PKG-INFO +1 -1
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/pyproject.toml +2 -1
- python_package_folder-4.3.0/src/python_package_folder/_hatch_build.py +84 -0
- python_package_folder-4.1.3/src/python_package_folder/_hatch_build.py +0 -54
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/.copier-answers.yml +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/.cursor/plans/optional_version_+_semantic-release_efed88a6.plan.md +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/.cursor/rules/general.mdc +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/.cursor/rules/python.mdc +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/.github/workflows/ci.yml +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/.github/workflows/publish.yml +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/.gitignore +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/.vscode/settings.json +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/LICENSE +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/Makefile +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/README.md +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/coverage.svg +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/development.md +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/installation.md +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/publishing.md +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/python_package_folder/scripts/get-next-version.cjs +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/scripts/get-next-version.cjs +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/__init__.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/__main__.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/analyzer.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/finder.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/manager.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/publisher.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/py.typed +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/python_package_folder.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/subfolder_build.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/types.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/utils.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/version.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/conftest.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/folder_structure/some_globals.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/folder_structure/subfolder_to_build/README.md +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/folder_structure/subfolder_to_build/__init__.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/folder_structure/subfolder_to_build/some_function.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/folder_structure/subfolder_to_build/some_globals.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/folder_structure/utility_folder/_SS/some_superseded_file.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/folder_structure/utility_folder/some_utility.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_build_with_external_deps.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_linting.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_preserve_directory_structure.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_publisher.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_shared_subdirectory_imports.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_spreadsheet_creation_imports.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_subfolder_build.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_third_party_dependencies.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_utils.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_version_manager.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/tests.py +0 -0
- {python_package_folder-4.1.3 → python_package_folder-4.3.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-package-folder
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.3.0
|
|
4
4
|
Summary: Python package to automatically package and build a folder, fetching all relevant dependencies.
|
|
5
5
|
Project-URL: Repository, https://github.com/alelom/python-package-folder
|
|
6
6
|
Author-email: Alessio Lombardi <work@alelom.com>
|
|
@@ -42,7 +42,7 @@ dependencies = [
|
|
|
42
42
|
|
|
43
43
|
# ---- Dev dependencies ----
|
|
44
44
|
|
|
45
|
-
version = "4.
|
|
45
|
+
version = "4.3.0"
|
|
46
46
|
[dependency-groups]
|
|
47
47
|
dev = [
|
|
48
48
|
"pytest>=8.3.5",
|
|
@@ -75,6 +75,7 @@ build-backend = "hatchling.build"
|
|
|
75
75
|
path = "src/python_package_folder/_hatch_build.py"
|
|
76
76
|
|
|
77
77
|
|
|
78
|
+
|
|
78
79
|
# ---- Settings ----
|
|
79
80
|
|
|
80
81
|
[tool.ruff]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Hatch build hook to automatically include all files from the scripts directory.
|
|
3
|
+
|
|
4
|
+
This hook ensures all non-Python files in the scripts directory are included
|
|
5
|
+
in the wheel without creating duplicates, and automatically includes any new
|
|
6
|
+
files added to the directory without requiring manual configuration updates.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import sys
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class CustomBuildHook(BuildHookInterface):
|
|
17
|
+
"""Build hook to include all files from the scripts directory."""
|
|
18
|
+
|
|
19
|
+
def initialize(self, version: str, build_data: dict[str, Any]) -> None:
|
|
20
|
+
"""Initialize the build hook and add scripts directory files."""
|
|
21
|
+
# Debug: Print to stderr so it shows in build output
|
|
22
|
+
print(f"[DEBUG] Build hook called. Root: {self.root}", file=sys.stderr)
|
|
23
|
+
|
|
24
|
+
# Try multiple possible locations for the scripts directory
|
|
25
|
+
# 1. Source layout: src/python_package_folder/scripts
|
|
26
|
+
# 2. Sdist layout: python_package_folder/scripts (after extraction)
|
|
27
|
+
# 3. Alternative sdist layout: scripts/ (if extracted differently)
|
|
28
|
+
possible_scripts_dirs = [
|
|
29
|
+
Path(self.root) / "src" / "python_package_folder" / "scripts",
|
|
30
|
+
Path(self.root) / "python_package_folder" / "scripts",
|
|
31
|
+
Path(self.root) / "scripts",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
scripts_dir = None
|
|
35
|
+
for possible_dir in possible_scripts_dirs:
|
|
36
|
+
if possible_dir.exists() and possible_dir.is_dir():
|
|
37
|
+
scripts_dir = possible_dir
|
|
38
|
+
print(f"[DEBUG] Found scripts dir at: {scripts_dir}", file=sys.stderr)
|
|
39
|
+
break
|
|
40
|
+
|
|
41
|
+
if scripts_dir is None:
|
|
42
|
+
print(f"[DEBUG] Scripts directory not found. Tried: {[str(d) for d in possible_scripts_dirs]}", file=sys.stderr)
|
|
43
|
+
return
|
|
44
|
+
|
|
45
|
+
# If scripts directory exists, include all files from it
|
|
46
|
+
if scripts_dir.exists() and scripts_dir.is_dir():
|
|
47
|
+
# Add all files from scripts directory to force-include
|
|
48
|
+
# This ensures they're included in the wheel at the correct location
|
|
49
|
+
for script_file in scripts_dir.iterdir():
|
|
50
|
+
if script_file.is_file():
|
|
51
|
+
# Calculate relative paths from project root
|
|
52
|
+
try:
|
|
53
|
+
source_path = script_file.relative_to(self.root)
|
|
54
|
+
except ValueError:
|
|
55
|
+
# If relative_to fails, try to construct path manually
|
|
56
|
+
# This can happen with sdist layouts
|
|
57
|
+
if "python_package_folder" in str(script_file):
|
|
58
|
+
# Extract the part after python_package_folder
|
|
59
|
+
parts = script_file.parts
|
|
60
|
+
try:
|
|
61
|
+
idx = parts.index("python_package_folder")
|
|
62
|
+
source_path = Path(*parts[idx:])
|
|
63
|
+
except (ValueError, IndexError):
|
|
64
|
+
# Fallback: use the filename
|
|
65
|
+
source_path = Path("python_package_folder") / "scripts" / script_file.name
|
|
66
|
+
else:
|
|
67
|
+
source_path = Path("python_package_folder") / "scripts" / script_file.name
|
|
68
|
+
|
|
69
|
+
# Target path inside the wheel package (always the same)
|
|
70
|
+
target_path = f"python_package_folder/scripts/{script_file.name}"
|
|
71
|
+
|
|
72
|
+
print(f"[DEBUG] Adding {source_path} -> {target_path}", file=sys.stderr)
|
|
73
|
+
|
|
74
|
+
# Add to force-include (hatchling will handle this)
|
|
75
|
+
# We need to add it to build_data['force_include']
|
|
76
|
+
if "force_include" not in build_data:
|
|
77
|
+
build_data["force_include"] = {}
|
|
78
|
+
build_data["force_include"][str(source_path)] = target_path
|
|
79
|
+
|
|
80
|
+
print(f"[DEBUG] force_include now has {len(build_data.get('force_include', {}))} entries", file=sys.stderr)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# Export the hook class (hatchling might need this)
|
|
84
|
+
__all__ = ["CustomBuildHook"]
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Hatch build hook to automatically include all files from the scripts directory.
|
|
3
|
-
|
|
4
|
-
This hook ensures all non-Python files in the scripts directory are included
|
|
5
|
-
in the wheel without creating duplicates, and automatically includes any new
|
|
6
|
-
files added to the directory without requiring manual configuration updates.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
import sys
|
|
10
|
-
from pathlib import Path
|
|
11
|
-
from typing import Any
|
|
12
|
-
|
|
13
|
-
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class CustomBuildHook(BuildHookInterface):
|
|
17
|
-
"""Build hook to include all files from the scripts directory."""
|
|
18
|
-
|
|
19
|
-
def initialize(self, version: str, build_data: dict[str, Any]) -> None:
|
|
20
|
-
"""Initialize the build hook and add scripts directory files."""
|
|
21
|
-
# Get the source directory for the package
|
|
22
|
-
source_dir = Path(self.root) / "src" / "python_package_folder"
|
|
23
|
-
scripts_dir = source_dir / "scripts"
|
|
24
|
-
|
|
25
|
-
# Debug: Print to stderr so it shows in build output
|
|
26
|
-
print(f"[DEBUG] Build hook called. Root: {self.root}", file=sys.stderr)
|
|
27
|
-
print(f"[DEBUG] Scripts dir exists: {scripts_dir.exists()}", file=sys.stderr)
|
|
28
|
-
|
|
29
|
-
# If scripts directory exists, include all files from it
|
|
30
|
-
if scripts_dir.exists() and scripts_dir.is_dir():
|
|
31
|
-
# Add all files from scripts directory to force-include
|
|
32
|
-
# This ensures they're included in the wheel at the correct location
|
|
33
|
-
for script_file in scripts_dir.iterdir():
|
|
34
|
-
if script_file.is_file():
|
|
35
|
-
# Calculate relative paths
|
|
36
|
-
source_path = script_file.relative_to(self.root)
|
|
37
|
-
# Target path inside the wheel package
|
|
38
|
-
target_path = f"python_package_folder/scripts/{script_file.name}"
|
|
39
|
-
|
|
40
|
-
print(f"[DEBUG] Adding {source_path} -> {target_path}", file=sys.stderr)
|
|
41
|
-
|
|
42
|
-
# Add to force-include (hatchling will handle this)
|
|
43
|
-
# We need to add it to build_data['force_include']
|
|
44
|
-
if "force_include" not in build_data:
|
|
45
|
-
build_data["force_include"] = {}
|
|
46
|
-
build_data["force_include"][str(source_path)] = target_path
|
|
47
|
-
|
|
48
|
-
print(f"[DEBUG] force_include now has {len(build_data.get('force_include', {}))} entries", file=sys.stderr)
|
|
49
|
-
else:
|
|
50
|
-
print(f"[DEBUG] Scripts directory not found at {scripts_dir}", file=sys.stderr)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
# Export the hook class (hatchling might need this)
|
|
54
|
-
__all__ = ["CustomBuildHook"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/__init__.py
RENAMED
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/__main__.py
RENAMED
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/analyzer.py
RENAMED
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/finder.py
RENAMED
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/manager.py
RENAMED
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/publisher.py
RENAMED
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/types.py
RENAMED
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/utils.py
RENAMED
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/src/python_package_folder/version.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/folder_structure/some_globals.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_build_with_external_deps.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_package_folder-4.1.3 → python_package_folder-4.3.0}/tests/test_third_party_dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|