scitex-path 0.1.2__tar.gz → 0.1.4__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.
- scitex_path-0.1.4/.github/workflows/install-test.yml +70 -0
- scitex_path-0.1.4/.github/workflows/test.yml +46 -0
- scitex_path-0.1.4/.readthedocs.yaml +22 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/PKG-INFO +28 -3
- {scitex_path-0.1.2 → scitex_path-0.1.4}/README.md +11 -0
- scitex_path-0.1.4/docs/sphinx/api/scitex_path.rst +7 -0
- scitex_path-0.1.4/docs/sphinx/conf.py +120 -0
- scitex_path-0.1.4/docs/sphinx/index.rst +29 -0
- scitex_path-0.1.4/docs/sphinx/installation.rst +23 -0
- scitex_path-0.1.4/docs/sphinx/quickstart.rst +7 -0
- scitex_path-0.1.4/docs/sphinx/requirements.txt +5 -0
- scitex_path-0.1.4/examples/quickstart.py +39 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/pyproject.toml +22 -8
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/__init__.py +10 -0
- scitex_path-0.1.4/tests/test_examples.py +22 -0
- scitex_path-0.1.2/.github/workflows/test.yml +0 -30
- {scitex_path-0.1.2 → scitex_path-0.1.4}/.github/workflows/cla.yml +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/.github/workflows/publish-pypi.yml +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/.gitignore +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/CLA.md +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/CONTRIBUTING.md +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/DELEGATION_TEMPLATE.txt +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/LICENSE +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_clean.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_find.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_get_module_path.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_get_spath.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_getsize.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_increment_version.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_mk_spath.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_path.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_skills/scitex-path/01_quick-start.md +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_skills/scitex-path/02_python-api.md +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_skills/scitex-path/SKILL.md +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_split.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_symlink.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_this_path.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_version.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__clean.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__find.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__get_module_path.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__get_spath.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__getsize.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__increment_version.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__mk_spath.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__path.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__split.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__symlink.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__this_path.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test__version.py +0 -0
- {scitex_path-0.1.2 → scitex_path-0.1.4}/tests/test_skills_quality.py +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: Install Test (fresh venv)
|
|
2
|
+
|
|
3
|
+
# Catches undeclared runtime deps that the package's own test suite misses.
|
|
4
|
+
# A package can build, upload, and pass its own tests with the wrong
|
|
5
|
+
# pyproject.toml — the bug only shows up when a fresh user runs
|
|
6
|
+
# `pip install <pkg>` in a clean venv. This job reproduces that path.
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches: [main, develop]
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [main, develop]
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
install-test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: ${{ matrix.python-version }}
|
|
29
|
+
|
|
30
|
+
- name: Build wheel
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip build
|
|
33
|
+
python -m build --wheel
|
|
34
|
+
|
|
35
|
+
- name: Install + import in a fresh venv
|
|
36
|
+
run: |
|
|
37
|
+
python -m venv /tmp/clean-venv
|
|
38
|
+
/tmp/clean-venv/bin/pip install --upgrade pip
|
|
39
|
+
/tmp/clean-venv/bin/pip install dist/*.whl
|
|
40
|
+
# Detect import name from src/ layout (the only directory under
|
|
41
|
+
# src/ that contains __init__.py). Works on every supported Python
|
|
42
|
+
# without needing tomllib (3.11+) or tomli (extra dep).
|
|
43
|
+
IMPORT_NAME=$(find src -maxdepth 2 -name __init__.py -printf '%h\n' \
|
|
44
|
+
| head -1 | xargs -n1 basename)
|
|
45
|
+
if [ -z "$IMPORT_NAME" ]; then
|
|
46
|
+
echo "Could not detect import name under src/" >&2
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
echo "Importing $IMPORT_NAME ..."
|
|
50
|
+
/tmp/clean-venv/bin/python -c "import ${IMPORT_NAME}; print(f'OK: {${IMPORT_NAME}.__name__}')"
|
|
51
|
+
|
|
52
|
+
- name: Audit declared deps vs actual imports (best-effort)
|
|
53
|
+
# Secondary check using scitex_dev.audit_dependencies(). Non-fatal:
|
|
54
|
+
# skipped if scitex-dev isn't yet available on PyPI for this Python.
|
|
55
|
+
continue-on-error: true
|
|
56
|
+
run: |
|
|
57
|
+
/tmp/clean-venv/bin/pip install scitex-dev 2>/dev/null || (
|
|
58
|
+
echo "scitex-dev not installable on this Python; skipping"
|
|
59
|
+
exit 0
|
|
60
|
+
)
|
|
61
|
+
/tmp/clean-venv/bin/python -c "
|
|
62
|
+
try:
|
|
63
|
+
from scitex_dev import audit_dependencies
|
|
64
|
+
except ImportError:
|
|
65
|
+
import sys; sys.exit(0)
|
|
66
|
+
rep = audit_dependencies('.')
|
|
67
|
+
print(rep)
|
|
68
|
+
import sys
|
|
69
|
+
sys.exit(0 if rep.is_clean else 1)
|
|
70
|
+
"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "0 7 * * *" # nightly 07:00 UTC
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
- name: Install package + dev deps + test plugins
|
|
26
|
+
run: |
|
|
27
|
+
pip install --upgrade pip
|
|
28
|
+
pip install pytest pytest-cov pytest-timeout
|
|
29
|
+
pip install -e ".[dev]" || pip install -e .
|
|
30
|
+
- name: Detect import name
|
|
31
|
+
id: pkg
|
|
32
|
+
run: |
|
|
33
|
+
IMPORT_NAME=$(find src -maxdepth 2 -name __init__.py -printf '%h\n' | head -1 | xargs -n1 basename)
|
|
34
|
+
echo "import_name=${IMPORT_NAME}" >> "$GITHUB_OUTPUT"
|
|
35
|
+
- name: Run tests with coverage
|
|
36
|
+
run: |
|
|
37
|
+
python -m pytest "$GITHUB_WORKSPACE/tests/" -v --tb=short --timeout=120 \
|
|
38
|
+
--cov=src/${{ steps.pkg.outputs.import_name }} \
|
|
39
|
+
--cov-report=xml --cov-report=term
|
|
40
|
+
- name: Upload coverage to Codecov
|
|
41
|
+
if: matrix.python-version == '3.12'
|
|
42
|
+
uses: codecov/codecov-action@v4
|
|
43
|
+
with:
|
|
44
|
+
files: coverage.xml
|
|
45
|
+
fail_ci_if_error: false
|
|
46
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Read the Docs configuration file
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
|
|
6
|
+
build:
|
|
7
|
+
os: ubuntu-22.04
|
|
8
|
+
tools:
|
|
9
|
+
python: "3.11"
|
|
10
|
+
|
|
11
|
+
sphinx:
|
|
12
|
+
configuration: docs/sphinx/conf.py
|
|
13
|
+
fail_on_warning: false
|
|
14
|
+
|
|
15
|
+
# Disable PDF/ePub to avoid multi-file output errors
|
|
16
|
+
formats: []
|
|
17
|
+
|
|
18
|
+
python:
|
|
19
|
+
install:
|
|
20
|
+
- requirements: docs/sphinx/requirements.txt
|
|
21
|
+
- method: pip
|
|
22
|
+
path: .
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scitex-path
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Scientific project path utilities (find, split, symlink, versioning)
|
|
5
5
|
Project-URL: Homepage, https://github.com/ywatanabe1989/scitex-path
|
|
6
6
|
Project-URL: Repository, https://github.com/ywatanabe1989/scitex-path
|
|
7
7
|
Project-URL: Issues, https://github.com/ywatanabe1989/scitex-path/issues
|
|
8
8
|
Author: Yusuke Watanabe
|
|
9
|
-
License-Expression: AGPL-3.0
|
|
9
|
+
License-Expression: AGPL-3.0-only
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Keywords: path,science,symlink,utilities,versioning
|
|
12
12
|
Classifier: Development Status :: 3 - Alpha
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: Intended Audience :: Science/Research
|
|
15
|
-
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
|
16
15
|
Classifier: Programming Language :: Python :: 3
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -20,15 +19,41 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
21
|
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: numpy
|
|
23
23
|
Provides-Extra: all
|
|
24
|
+
Requires-Dist: myst-parser>=2.0; extra == 'all'
|
|
25
|
+
Requires-Dist: pytest; extra == 'all'
|
|
26
|
+
Requires-Dist: pytest-cov; extra == 'all'
|
|
27
|
+
Requires-Dist: scitex-dev>=0.7.0; extra == 'all'
|
|
28
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.25; extra == 'all'
|
|
29
|
+
Requires-Dist: sphinx-copybutton>=0.5; extra == 'all'
|
|
30
|
+
Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'all'
|
|
31
|
+
Requires-Dist: sphinx>=7.0; extra == 'all'
|
|
24
32
|
Provides-Extra: dev
|
|
25
33
|
Requires-Dist: pytest; extra == 'dev'
|
|
26
34
|
Requires-Dist: pytest-cov; extra == 'dev'
|
|
27
35
|
Requires-Dist: scitex-dev>=0.7.0; extra == 'dev'
|
|
36
|
+
Provides-Extra: docs
|
|
37
|
+
Requires-Dist: myst-parser>=2.0; extra == 'docs'
|
|
38
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.25; extra == 'docs'
|
|
39
|
+
Requires-Dist: sphinx-copybutton>=0.5; extra == 'docs'
|
|
40
|
+
Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'docs'
|
|
41
|
+
Requires-Dist: sphinx>=7.0; extra == 'docs'
|
|
28
42
|
Description-Content-Type: text/markdown
|
|
29
43
|
|
|
30
44
|
# scitex-path
|
|
31
45
|
|
|
46
|
+
<!-- scitex-badges:start -->
|
|
47
|
+
[](https://pypi.org/project/scitex-path/)
|
|
48
|
+
[](https://pypi.org/project/scitex-path/)
|
|
49
|
+
[](https://github.com/ywatanabe1989/scitex-path/actions/workflows/test.yml)
|
|
50
|
+
[](https://github.com/ywatanabe1989/scitex-path/actions/workflows/install-test.yml)
|
|
51
|
+
[](https://codecov.io/gh/ywatanabe1989/scitex-path)
|
|
52
|
+
[](https://scitex-path.readthedocs.io/en/latest/)
|
|
53
|
+
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
54
|
+
<!-- scitex-badges:end -->
|
|
55
|
+
|
|
56
|
+
|
|
32
57
|
Scientific project path utilities for the [SciTeX](https://github.com/ywatanabe1989/scitex-python) ecosystem.
|
|
33
58
|
|
|
34
59
|
Provides file/directory finding, path splitting, symlink management, and version incrementing.
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# scitex-path
|
|
2
2
|
|
|
3
|
+
<!-- scitex-badges:start -->
|
|
4
|
+
[](https://pypi.org/project/scitex-path/)
|
|
5
|
+
[](https://pypi.org/project/scitex-path/)
|
|
6
|
+
[](https://github.com/ywatanabe1989/scitex-path/actions/workflows/test.yml)
|
|
7
|
+
[](https://github.com/ywatanabe1989/scitex-path/actions/workflows/install-test.yml)
|
|
8
|
+
[](https://codecov.io/gh/ywatanabe1989/scitex-path)
|
|
9
|
+
[](https://scitex-path.readthedocs.io/en/latest/)
|
|
10
|
+
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
11
|
+
<!-- scitex-badges:end -->
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
Scientific project path utilities for the [SciTeX](https://github.com/ywatanabe1989/scitex-python) ecosystem.
|
|
4
15
|
|
|
5
16
|
Provides file/directory finding, path splitting, symlink management, and version incrementing.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""Sphinx configuration for scitex-path documentation."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
sys.path.insert(0, os.path.abspath("../../src"))
|
|
7
|
+
|
|
8
|
+
# -- Project information -----------------------------------------------------
|
|
9
|
+
|
|
10
|
+
project = "SciTeX Path"
|
|
11
|
+
copyright = "2024-2026, Yusuke Watanabe"
|
|
12
|
+
author = "Yusuke Watanabe"
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
from importlib.metadata import version as _get_version
|
|
16
|
+
|
|
17
|
+
release = _get_version("scitex-path")
|
|
18
|
+
except Exception:
|
|
19
|
+
release = "0.1.0"
|
|
20
|
+
|
|
21
|
+
# -- General configuration ---------------------------------------------------
|
|
22
|
+
|
|
23
|
+
extensions = [
|
|
24
|
+
"sphinx.ext.autodoc",
|
|
25
|
+
"sphinx.ext.autosummary",
|
|
26
|
+
"sphinx.ext.napoleon",
|
|
27
|
+
"sphinx.ext.viewcode",
|
|
28
|
+
"sphinx.ext.intersphinx",
|
|
29
|
+
"sphinx.ext.coverage",
|
|
30
|
+
"sphinx_rtd_theme",
|
|
31
|
+
"myst_parser",
|
|
32
|
+
"sphinx_copybutton",
|
|
33
|
+
"sphinx_autodoc_typehints",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
autodoc_default_options = {
|
|
37
|
+
"members": True,
|
|
38
|
+
"member-order": "bysource",
|
|
39
|
+
"special-members": "__init__",
|
|
40
|
+
"undoc-members": True,
|
|
41
|
+
"exclude-members": "__weakref__",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
autodoc_mock_imports = [
|
|
45
|
+
"fastmcp",
|
|
46
|
+
"click",
|
|
47
|
+
"h5py",
|
|
48
|
+
"zarr",
|
|
49
|
+
"torch",
|
|
50
|
+
"scipy",
|
|
51
|
+
"matplotlib",
|
|
52
|
+
"PIL",
|
|
53
|
+
"cv2",
|
|
54
|
+
"plotly",
|
|
55
|
+
"pandas",
|
|
56
|
+
"numpy",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
autosummary_generate = True
|
|
60
|
+
|
|
61
|
+
napoleon_google_docstring = True
|
|
62
|
+
napoleon_numpy_docstring = True
|
|
63
|
+
napoleon_include_init_with_doc = True
|
|
64
|
+
napoleon_include_private_with_doc = True
|
|
65
|
+
napoleon_include_special_with_doc = True
|
|
66
|
+
napoleon_use_admonition_for_examples = True
|
|
67
|
+
napoleon_use_admonition_for_notes = True
|
|
68
|
+
napoleon_use_admonition_for_references = True
|
|
69
|
+
napoleon_use_param = True
|
|
70
|
+
napoleon_use_rtype = True
|
|
71
|
+
napoleon_attr_annotations = True
|
|
72
|
+
|
|
73
|
+
templates_path = ["_templates"]
|
|
74
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "to_claude/**"]
|
|
75
|
+
|
|
76
|
+
source_suffix = {
|
|
77
|
+
".rst": "restructuredtext",
|
|
78
|
+
".md": "markdown",
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# -- Options for HTML output -------------------------------------------------
|
|
82
|
+
|
|
83
|
+
html_theme = "sphinx_rtd_theme"
|
|
84
|
+
|
|
85
|
+
html_theme_options = {
|
|
86
|
+
"navigation_depth": 4,
|
|
87
|
+
"collapse_navigation": False,
|
|
88
|
+
"sticky_navigation": True,
|
|
89
|
+
"includehidden": True,
|
|
90
|
+
"titles_only": False,
|
|
91
|
+
"prev_next_buttons_location": "bottom",
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
html_static_path = ["_static"]
|
|
95
|
+
html_title = f"{project} v{release}"
|
|
96
|
+
html_short_title = project
|
|
97
|
+
|
|
98
|
+
html_context = {
|
|
99
|
+
"display_github": True,
|
|
100
|
+
"github_user": "ywatanabe1989",
|
|
101
|
+
"github_repo": "scitex-path",
|
|
102
|
+
"github_version": "develop",
|
|
103
|
+
"conf_py_path": "/docs/sphinx/",
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
myst_enable_extensions = [
|
|
107
|
+
"dollarmath",
|
|
108
|
+
"colon_fence",
|
|
109
|
+
"deflist",
|
|
110
|
+
"html_admonition",
|
|
111
|
+
"html_image",
|
|
112
|
+
"replacements",
|
|
113
|
+
"smartquotes",
|
|
114
|
+
"substitution",
|
|
115
|
+
"tasklist",
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
intersphinx_mapping = {
|
|
119
|
+
"python": ("https://docs.python.org/3", None),
|
|
120
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
SciTeX Path
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
``scitex-path`` is part of the `SciTeX <https://scitex.ai>`_ ecosystem.
|
|
5
|
+
|
|
6
|
+
.. code-block:: bash
|
|
7
|
+
|
|
8
|
+
pip install scitex-path
|
|
9
|
+
|
|
10
|
+
.. toctree::
|
|
11
|
+
:maxdepth: 2
|
|
12
|
+
:caption: Getting Started
|
|
13
|
+
|
|
14
|
+
installation
|
|
15
|
+
quickstart
|
|
16
|
+
|
|
17
|
+
.. toctree::
|
|
18
|
+
:maxdepth: 2
|
|
19
|
+
:caption: API Reference
|
|
20
|
+
|
|
21
|
+
api/scitex_path
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Indices and tables
|
|
25
|
+
==================
|
|
26
|
+
|
|
27
|
+
* :ref:`genindex`
|
|
28
|
+
* :ref:`modindex`
|
|
29
|
+
* :ref:`search`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Installation
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
Requirements
|
|
5
|
+
------------
|
|
6
|
+
|
|
7
|
+
- Python >= 3.9
|
|
8
|
+
|
|
9
|
+
Basic Installation
|
|
10
|
+
------------------
|
|
11
|
+
|
|
12
|
+
.. code-block:: bash
|
|
13
|
+
|
|
14
|
+
pip install scitex-path
|
|
15
|
+
|
|
16
|
+
Development
|
|
17
|
+
-----------
|
|
18
|
+
|
|
19
|
+
.. code-block:: bash
|
|
20
|
+
|
|
21
|
+
git clone https://github.com/ywatanabe1989/scitex-path.git
|
|
22
|
+
cd scitex-path
|
|
23
|
+
pip install -e ".[dev]"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""scitex-path quickstart: filesystem path utilities."""
|
|
2
|
+
|
|
3
|
+
import tempfile
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import scitex_path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def main():
|
|
10
|
+
with tempfile.TemporaryDirectory() as td:
|
|
11
|
+
td = Path(td)
|
|
12
|
+
|
|
13
|
+
# 1. split — split a path into (dir, basename, ext).
|
|
14
|
+
head, base, ext = scitex_path.split("/tmp/foo/bar.txt")
|
|
15
|
+
print("split:", head, base, ext)
|
|
16
|
+
assert ext == ".txt"
|
|
17
|
+
|
|
18
|
+
# 2. clean — normalize a path string.
|
|
19
|
+
cleaned = scitex_path.clean("/tmp//foo/./bar")
|
|
20
|
+
print("clean:", cleaned)
|
|
21
|
+
|
|
22
|
+
# 3. getsize — bytes for a file.
|
|
23
|
+
f = td / "data.bin"
|
|
24
|
+
f.write_bytes(b"\0" * 1024)
|
|
25
|
+
print("getsize:", scitex_path.getsize(str(f)))
|
|
26
|
+
assert scitex_path.getsize(str(f)) == 1024
|
|
27
|
+
|
|
28
|
+
# 4. find_file / find_dir — recursive locator.
|
|
29
|
+
sub = td / "sub"
|
|
30
|
+
sub.mkdir()
|
|
31
|
+
target = sub / "needle.txt"
|
|
32
|
+
target.write_text("x")
|
|
33
|
+
hits = scitex_path.find_file(str(td), "needle.txt")
|
|
34
|
+
print("find_file hits:", hits)
|
|
35
|
+
assert any("needle.txt" in h for h in hits)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
main()
|
|
@@ -4,10 +4,10 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scitex-path"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.4"
|
|
8
8
|
description = "Scientific project path utilities (find, split, symlink, versioning)"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
license = "AGPL-3.0"
|
|
10
|
+
license = "AGPL-3.0-only"
|
|
11
11
|
requires-python = ">=3.10"
|
|
12
12
|
authors = [
|
|
13
13
|
{ name = "Yusuke Watanabe" },
|
|
@@ -17,7 +17,6 @@ classifiers = [
|
|
|
17
17
|
"Development Status :: 3 - Alpha",
|
|
18
18
|
"Intended Audience :: Developers",
|
|
19
19
|
"Intended Audience :: Science/Research",
|
|
20
|
-
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
|
|
21
20
|
"Programming Language :: Python :: 3",
|
|
22
21
|
"Programming Language :: Python :: 3.10",
|
|
23
22
|
"Programming Language :: Python :: 3.11",
|
|
@@ -26,12 +25,24 @@ classifiers = [
|
|
|
26
25
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
27
26
|
]
|
|
28
27
|
|
|
29
|
-
[
|
|
30
|
-
# Bare install is the full package; [all] is provided for ecosystem-wide
|
|
31
|
-
# consistency so `pip install scitex-*[all]` works uniformly.
|
|
32
|
-
all = []
|
|
28
|
+
dependencies = ["numpy"]
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
dev = [
|
|
32
|
+
"pytest",
|
|
33
|
+
"pytest-cov",
|
|
34
|
+
"scitex-dev>=0.7.0",
|
|
35
|
+
]
|
|
36
|
+
docs = [
|
|
37
|
+
"sphinx>=7.0",
|
|
38
|
+
"sphinx-rtd-theme>=2.0",
|
|
39
|
+
"myst-parser>=2.0",
|
|
40
|
+
"sphinx-copybutton>=0.5",
|
|
41
|
+
"sphinx-autodoc-typehints>=1.25",
|
|
42
|
+
]
|
|
43
|
+
all = [
|
|
44
|
+
"scitex-path[dev,docs]",
|
|
45
|
+
]
|
|
35
46
|
|
|
36
47
|
[project.urls]
|
|
37
48
|
Homepage = "https://github.com/ywatanabe1989/scitex-path"
|
|
@@ -57,3 +68,6 @@ line-length = 88
|
|
|
57
68
|
|
|
58
69
|
[tool.ruff.lint]
|
|
59
70
|
select = ["E", "F", "W", "I"]
|
|
71
|
+
|
|
72
|
+
[tool.scitex-linter]
|
|
73
|
+
library_dirs = ["src", "tests", "examples"]
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""scitex-path: Scientific project path utilities (find, split, symlink, versioning)."""
|
|
3
3
|
|
|
4
|
+
try:
|
|
5
|
+
from importlib.metadata import version as _v, PackageNotFoundError
|
|
6
|
+
try:
|
|
7
|
+
__version__ = _v("scitex-path")
|
|
8
|
+
except PackageNotFoundError:
|
|
9
|
+
__version__ = "0.0.0+local"
|
|
10
|
+
del _v, PackageNotFoundError
|
|
11
|
+
except ImportError: # pragma: no cover — only on ancient Pythons
|
|
12
|
+
__version__ = "0.0.0+local"
|
|
13
|
+
|
|
4
14
|
from ._clean import clean
|
|
5
15
|
from ._find import find_dir, find_file, find_git_root
|
|
6
16
|
from ._get_module_path import get_data_path_from_a_package
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Smoke test: every example script under examples/ runs to completion."""
|
|
2
|
+
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
EXAMPLES = sorted(Path(__file__).parent.parent.joinpath("examples").glob("*.py"))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def test_examples_smoke(tmp_path):
|
|
11
|
+
assert EXAMPLES, "No example scripts found under examples/"
|
|
12
|
+
for ex in EXAMPLES:
|
|
13
|
+
r = subprocess.run(
|
|
14
|
+
[sys.executable, str(ex)],
|
|
15
|
+
cwd=tmp_path,
|
|
16
|
+
capture_output=True,
|
|
17
|
+
text=True,
|
|
18
|
+
timeout=120,
|
|
19
|
+
)
|
|
20
|
+
assert r.returncode == 0, (
|
|
21
|
+
f"{ex.name} failed:\nSTDOUT:\n{r.stdout}\nSTDERR:\n{r.stderr}"
|
|
22
|
+
)
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: Test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main, develop]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main, develop]
|
|
8
|
-
schedule:
|
|
9
|
-
- cron: "0 7 * * *" # nightly 07:00 UTC
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
test:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
strategy:
|
|
16
|
-
matrix:
|
|
17
|
-
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v4
|
|
20
|
-
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
-
uses: actions/setup-python@v5
|
|
22
|
-
with:
|
|
23
|
-
python-version: ${{ matrix.python-version }}
|
|
24
|
-
- name: Install dependencies
|
|
25
|
-
run: |
|
|
26
|
-
python -m pip install --upgrade pip
|
|
27
|
-
pip install -e .
|
|
28
|
-
pip install pytest pytest-cov scitex-dev numpy
|
|
29
|
-
- name: Run tests
|
|
30
|
-
run: pytest tests/
|
|
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
|
{scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_skills/scitex-path/01_quick-start.md
RENAMED
|
File without changes
|
{scitex_path-0.1.2 → scitex_path-0.1.4}/src/scitex_path/_skills/scitex-path/02_python-api.md
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|