Skip to content

Commit e9a35a8

Browse files
committed
Used find-project-root pkg in Py scripts
1 parent 756ef4c commit e9a35a8

45 files changed

Lines changed: 105 additions & 36 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

computer-languages/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Repository = "https://github.com/adamlui/python-utils"
110110

111111
[project.optional-dependencies]
112112
dev = [
113+
"find-project-root>=1.0.4,<2",
113114
"nox>=2026.4.10",
114115
"pre-commit>=4.5.1,<5",
115116
"tomli>=2.4.1,<3",

computer-languages/utils/bump.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
from pathlib import Path
33
from types import SimpleNamespace as sn
44

5+
import find_project_root
6+
57
from .lib import data, log, toml
68

7-
paths = sn(root=Path(__file__).parent.parent)
9+
paths = sn(root=Path(find_project_root())) # type: ignore
810
paths.pyproject = paths.root / 'pyproject.toml'
911
paths.readme = paths.root / 'docs/README.md'
1012
paths.util_msgs = paths.root / 'utils/data/messages.json'

computer-languages/utils/clean.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
import shutil, sys
33
from types import SimpleNamespace as sn
44

5+
import find_project_root
6+
57
from .lib import data, log
68

79
def main():
8-
msgs_path = Path(__file__).parent / 'data/messages.json'
10+
msgs_path = Path(find_project_root()) / 'data/messages.json' # type: ignore
911
msgs = sn(**{ key:val['message'] for key,val in data.json.read(msgs_path)['clean'].items() })
1012
targets = ['*.pyc']
1113
if '--py2' not in sys.argv:

data-languages/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Repository = "https://github.com/adamlui/python-utils"
8282

8383
[project.optional-dependencies]
8484
dev = [
85+
"find-project-root>=1.0.4,<2",
8586
"nox>=2026.4.10",
8687
"pre-commit>=4.5.1,<5",
8788
"tomli>=2.4.1,<3",

data-languages/utils/bump.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
from pathlib import Path
33
from types import SimpleNamespace as sn
44

5+
import find_project_root
6+
57
from .lib import data, log, toml
68

7-
paths = sn(root=Path(__file__).parent.parent)
9+
paths = sn(root=Path(find_project_root())) # type: ignore
810
paths.pyproject = paths.root / 'pyproject.toml'
911
paths.readme = paths.root / 'docs/README.md'
1012
paths.util_msgs = paths.root / 'utils/data/messages.json'

data-languages/utils/clean.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
import shutil, sys
33
from types import SimpleNamespace as sn
44

5+
import find_project_root
6+
57
from .lib import data, log
68

79
def main():
8-
msgs_path = Path(__file__).parent / 'data/messages.json'
10+
msgs_path = Path(find_project_root()) / 'data/messages.json' # type: ignore
911
msgs = sn(**{ key:val['message'] for key,val in data.json.read(msgs_path)['clean'].items() })
1012
targets = ['*.pyc']
1113
if '--py2' not in sys.argv:

find-project-root/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Repository = "https://github.com/adamlui/python-utils"
7474

7575
[project.optional-dependencies]
7676
dev = [
77+
"find-project-root>=1.0.4,<2",
7778
"nox>=2026.4.10",
7879
"pre-commit>=4.5.1,<5",
7980
"tomli>=2.4.1,<3",

find-project-root/utils/bump.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
from pathlib import Path
33
from types import SimpleNamespace as sn
44

5+
import find_project_root
6+
57
from .lib import data, log, toml
68

7-
paths = sn(root=Path(__file__).parent.parent)
9+
paths = sn(root=Path(find_project_root())) # type: ignore
810
paths.pyproject = paths.root / 'pyproject.toml'
911
paths.readme = paths.root / 'docs/README.md'
1012
paths.util_msgs = paths.root / 'utils/data/messages.json'

find-project-root/utils/clean.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
import shutil, sys
33
from types import SimpleNamespace as sn
44

5+
import find_project_root
6+
57
from .lib import data, log
68

79
def main():
8-
msgs_path = Path(__file__).parent / 'data/messages.json'
10+
msgs_path = Path(find_project_root()) / 'data/messages.json' # type: ignore
911
msgs = sn(**{ key:val['message'] for key,val in data.json.read(msgs_path)['clean'].items() })
1012
targets = ['*.pyc']
1113
if '--py2' not in sys.argv:

get-min-py/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ checkminver = "get_min_py.cli.__main__:main"
9595

9696
[project.optional-dependencies]
9797
dev = [
98+
"find-project-root>=1.0.4,<2",
9899
"nox>=2026.4.10",
99100
"pre-commit>=4.5.1,<5",
100101
"remove-json-keys>=1.10.1,<2",

0 commit comments

Comments
 (0)