ssb-project-cli 1.7.2__tar.gz → 1.8.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.
Files changed (27) hide show
  1. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/PKG-INFO +8 -7
  2. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/pyproject.toml +10 -11
  3. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/__init__.py +0 -1
  4. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/app.py +0 -1
  5. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/build/build.py +7 -7
  6. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/build/environment.py +2 -2
  7. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/build/poetry.py +15 -6
  8. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/settings.py +1 -2
  9. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/util.py +5 -5
  10. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/LICENSE +0 -0
  11. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/README.md +0 -0
  12. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/__init__.py +0 -0
  13. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/__main__.py +0 -0
  14. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/py.typed +0 -0
  15. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/build/__init__.py +0 -0
  16. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/build/prompt.py +0 -0
  17. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/build/temp_template_repo.py +0 -0
  18. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/build_cmds.md +0 -0
  19. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/clean/__init__.py +0 -0
  20. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/clean/clean.py +0 -0
  21. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/create/__init__.py +0 -0
  22. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/create/create.py +0 -0
  23. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/create/github.py +0 -0
  24. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/create/local_repo.py +0 -0
  25. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/create/prompt.py +0 -0
  26. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/create/repo_privacy.py +0 -0
  27. {ssb_project_cli-1.7.2 → ssb_project_cli-1.8.0}/src/ssb_project_cli/ssb_project/create/temp_git_repo.py +0 -0
@@ -1,28 +1,29 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: ssb-project-cli
3
- Version: 1.7.2
3
+ Version: 1.8.0
4
4
  Summary: SSB Project CLI
5
- License: MIT
5
+ License-Expression: MIT
6
+ License-File: LICENSE
6
7
  Author: Statistics Norway
7
8
  Author-email: stat-dev@ssb.no
8
9
  Requires-Python: >=3.10
9
10
  Classifier: Development Status :: 4 - Beta
10
- Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
16
17
  Requires-Dist: cruft (>=2.11.1)
17
- Requires-Dist: gitpython (>=3.1.27)
18
+ Requires-Dist: gitpython (>=3.1.59)
18
19
  Requires-Dist: ipykernel (>=6.25.2)
19
20
  Requires-Dist: jupyter-client (>=8.3.1)
20
- Requires-Dist: kvakk-git-tools (>=2.5.1)
21
+ Requires-Dist: kvakk-git-tools (>=2.6.1)
21
22
  Requires-Dist: poetry (>=2.0)
22
23
  Requires-Dist: psutil (>=5.9.4)
23
24
  Requires-Dist: pygithub (>=1.55)
24
25
  Requires-Dist: questionary (>=1.10.0)
25
- Requires-Dist: requests (>=2.32.3)
26
+ Requires-Dist: requests (>=2.33.0)
26
27
  Requires-Dist: rich (>=12.5.1)
27
28
  Requires-Dist: tomli (>=2.0.1)
28
29
  Requires-Dist: typer (==0.19.2)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ssb-project-cli"
3
- version = "1.7.2"
3
+ version = "1.8.0"
4
4
  requires-python = ">=3.10"
5
5
  description = "SSB Project CLI"
6
6
  license = "MIT"
@@ -9,14 +9,14 @@ readme = "README.md"
9
9
  authors = [{ name = "Statistics Norway", email = "stat-dev@ssb.no" }]
10
10
  dependencies = [
11
11
  'typer (==0.19.2)',
12
- 'gitpython (>=3.1.27)',
12
+ 'gitpython (>=3.1.59)',
13
13
  'pygithub (>=1.55)',
14
14
  'cruft (>=2.11.1)',
15
15
  'rich (>=12.5.1)',
16
- 'requests (>=2.32.3)',
16
+ 'requests (>=2.33.0)',
17
17
  'questionary (>=1.10.0)',
18
18
  'psutil (>=5.9.4)',
19
- 'kvakk-git-tools (>=2.5.1)',
19
+ 'kvakk-git-tools (>=2.6.1)',
20
20
  'poetry (>=2.0)',
21
21
  'jupyter-client (>=8.3.1)',
22
22
  'ipykernel (>=6.25.2)', # Run as a module, not imported in code
@@ -41,8 +41,8 @@ ssb-project = "ssb_project_cli.__main__:main"
41
41
  python = ">=3.10,<4.0"
42
42
 
43
43
  [tool.poetry.group.dev.dependencies]
44
- pygments = ">=2.10.0"
45
- black = ">=24.4.2"
44
+ pygments = ">=2.20.0"
45
+ black = ">=26.3.1"
46
46
  coverage = { extras = ["toml"], version = ">=6.2" }
47
47
  darglint = ">=1.8.1"
48
48
  flake8 = ">=4.0.1"
@@ -55,7 +55,7 @@ mypy = ">=0.930"
55
55
  pep8-naming = ">=0.12.1"
56
56
  pre-commit = ">=2.16.0"
57
57
  pre-commit-hooks = ">=4.1.0"
58
- pytest = ">=7.2.0"
58
+ pytest = ">=9.0.3"
59
59
  pyupgrade = ">=2.29.1"
60
60
  typeguard = ">=2.13.3"
61
61
  types-urllib3 = ">=1.26.25.10"
@@ -70,8 +70,8 @@ nox = ">=2025.02.09"
70
70
  nox-poetry = ">=1.1.0"
71
71
  tomli-w = ">=1.0.0"
72
72
  bandit = ">=1.7.9"
73
- cryptography = ">=42.0.8"
74
- idna = ">=3.7"
73
+ cryptography = ">=50.0.0"
74
+ idna = ">=3.15"
75
75
  deptry = "^0.23.1"
76
76
 
77
77
  [tool.poetry.group.docs.dependencies]
@@ -81,7 +81,7 @@ mkdocstrings-python = ">=1.3.0"
81
81
  mkdocstrings = "*"
82
82
  mkdocs-literate-nav = ">=0.5.0"
83
83
  mkdocs-section-index = ">=0.3.4"
84
- mkdocs-material = ">=9.5.27"
84
+ mkdocs-material = ">=9.7.7"
85
85
  mkdocs-gen-files = ">=0.4.0"
86
86
  sphinx = ">=4.3.2"
87
87
  sphinx-autobuild = ">=2021.3.14"
@@ -112,7 +112,6 @@ fail_under = 80
112
112
  [tool.isort]
113
113
  profile = "black"
114
114
  force_single_line = true
115
- lines_after_imports = 2
116
115
 
117
116
  [tool.mypy]
118
117
  strict = true
@@ -2,7 +2,6 @@
2
2
 
3
3
  from questionary import Style
4
4
 
5
-
6
5
  prompt_autocomplete_style = Style(
7
6
  [
8
7
  ("answer", "fg:#000000 bold"), # submitted answer text behind the question
@@ -21,7 +21,6 @@ from .settings import STAT_TEMPLATE_DEFAULT_REFERENCE
21
21
  from .settings import STAT_TEMPLATE_REPO_URL
22
22
  from .util import handle_no_kernel_argument
23
23
 
24
-
25
24
  # Don't print with color, it's difficult to read when run in Jupyter
26
25
  rich_utils.STYLE_OPTION = ""
27
26
  rich_utils.STYLE_SWITCH = ""
@@ -8,7 +8,7 @@ from pathlib import Path
8
8
  from typing import List
9
9
  from ..util import try_if_file_exists
10
10
 
11
- import kvakk_git_tools # type: ignore
11
+ import kvakk_git_tools
12
12
  from rich import print
13
13
 
14
14
  from ssb_project_cli.ssb_project.util import (
@@ -76,24 +76,24 @@ def validate_and_fix_git_config(
76
76
  project_root: The root directory of the project/repo.
77
77
  """
78
78
  valid_global_git_config: bool = try_if_file_exists(
79
- lambda: kvakk_git_tools.validate_git_config()
79
+ lambda: kvakk_git_tools.validate_git_config() # type: ignore[attr-defined]
80
80
  ).get_or_else(False)
81
81
  valid_project_git_files: bool = try_if_file_exists(
82
- lambda: kvakk_git_tools.validate_local_git_files(cwd=Path(str(project_root)))
82
+ lambda: kvakk_git_tools.validate_local_git_files( # type: ignore[attr-defined]
83
+ cwd=Path(str(project_root))
84
+ )
83
85
  ).get_or_else(False)
84
86
 
85
87
  if not (valid_global_git_config and valid_project_git_files):
86
88
 
87
- print(
88
- f"""
89
+ print(f"""
89
90
  :x: Your project's Git configuration does not follow SSB recommendations,
90
91
  :x: which may result in sensitive data being pushed to GitHub.
91
92
 
92
93
  Git file validation status:
93
94
  {":white_check_mark:" if valid_global_git_config else ":x:"} - Global .gitconfig file
94
95
  {":white_check_mark:" if valid_project_git_files else ":x:"} - Project .gitignore and .gitattributes files
95
- """
96
- )
96
+ """)
97
97
  confirm_fix_ssb_git_config(
98
98
  project_name,
99
99
  template_repo_url,
@@ -1,7 +1,7 @@
1
1
  """This module reads in environment variables."""
2
2
 
3
3
  import os
4
- from kvakk_git_tools import ssb_gitconfig # type: ignore
4
+ from kvakk_git_tools import ssb_gitconfig
5
5
  from rich import print
6
6
 
7
7
  JUPYTER_IMAGE_SPEC = os.environ.get("JUPYTER_IMAGE_SPEC", "")
@@ -32,7 +32,7 @@ def reset_global_gitconfig() -> None:
32
32
  try:
33
33
  ssb_gitconfig.main(test=False)
34
34
  except SystemExit:
35
- platform = ssb_gitconfig.Platform()
35
+ platform = ssb_gitconfig.Platform() # type: ignore[no-untyped-call]
36
36
  is_supported_bools = ("is", "is not")
37
37
  print(
38
38
  f"\n:x:\tYour global gitconfig was not fixed, your platform {is_supported_bools[platform.is_unsupported()]} supported."
@@ -4,15 +4,22 @@ import os
4
4
  from pathlib import Path
5
5
 
6
6
  from rich import print
7
- from rich.progress import Progress, SpinnerColumn, TextColumn
7
+ from rich.progress import Progress
8
+ from rich.progress import SpinnerColumn
9
+ from rich.progress import TextColumn
8
10
 
9
11
  from ssb_project_cli.ssb_project.util import execute_command
10
12
 
11
- from .environment import (
12
- JUPYTER_IMAGE_SPEC,
13
- NEXUS_SOURCE_NAME,
14
- running_onprem,
15
- )
13
+ from .environment import JUPYTER_IMAGE_SPEC
14
+ from .environment import NEXUS_SOURCE_NAME
15
+ from .environment import running_onprem
16
+
17
+
18
+ def poetry_environment() -> dict[str, str]:
19
+ """Return an environment where Poetry can create the project's own venv."""
20
+ env = os.environ.copy()
21
+ env.pop("VIRTUAL_ENV", None)
22
+ return env
16
23
 
17
24
 
18
25
  def poetry_install(project_directory: Path) -> None:
@@ -37,6 +44,7 @@ def poetry_install(project_directory: Path) -> None:
37
44
  ":white_check_mark:\tInstalled dependencies in the virtual environment",
38
45
  "Error: Something went wrong when installing packages with Poetry.",
39
46
  project_directory,
47
+ env=poetry_environment(),
40
48
  )
41
49
 
42
50
 
@@ -195,6 +203,7 @@ def install_ipykernel(project_directory: Path, project_name: str) -> None:
195
203
  f":white_check_mark:\tInstalled Jupyter Kernel ({project_name})",
196
204
  "Something went wrong while installing ipykernel.",
197
205
  project_directory,
206
+ env=poetry_environment(),
198
207
  )
199
208
 
200
209
 
@@ -3,11 +3,10 @@
3
3
  import os
4
4
  from pathlib import Path
5
5
 
6
-
7
6
  GITHUB_ORG_NAME = "statisticsnorway"
8
7
  HOME_PATH = Path.home()
9
8
  CURRENT_WORKING_DIRECTORY = Path.cwd()
10
9
  STAT_TEMPLATE_REPO_URL = "https://github.com/statisticsnorway/ssb-project-template-stat"
11
10
  STAT_TEMPLATE_DEFAULT_REFERENCE = os.environ.get(
12
- "STAT_TEMPLATE_DEFAULT_REFERENCE", "1.4.0"
11
+ "STAT_TEMPLATE_DEFAULT_REFERENCE", "1.8.0"
13
12
  )
@@ -20,7 +20,6 @@ from rich import print
20
20
 
21
21
  from .settings import HOME_PATH
22
22
 
23
-
24
23
  kernelspec_manager = jupyter_client.kernelspec.KernelSpecManager()
25
24
 
26
25
  T = TypeVar("T")
@@ -136,6 +135,7 @@ def execute_command(
136
135
  success_desc: Optional[str] = None,
137
136
  failure_desc: Optional[str] = None,
138
137
  cwd: Optional[Path] = None,
138
+ env: Optional[dict[str, str]] = None,
139
139
  ) -> subprocess.CompletedProcess[bytes]:
140
140
  """Execute command and handle failure/success cases.
141
141
 
@@ -145,6 +145,7 @@ def execute_command(
145
145
  success_desc: For example: "Poetry install ran successfully".
146
146
  failure_desc: For example: "Something went wrong while running poetry install".
147
147
  cwd: The current working directory.
148
+ env: Environment variables for the command.
148
149
 
149
150
  Returns:
150
151
  The result of the subprocess.
@@ -155,6 +156,7 @@ def execute_command(
155
156
  command,
156
157
  capture_output=True,
157
158
  cwd=cwd,
159
+ env=env,
158
160
  )
159
161
 
160
162
  if result.returncode != 0:
@@ -253,12 +255,10 @@ def handle_no_kernel_argument(no_kernel: bool) -> bool:
253
255
  if env_var_no_kernel is None: # handle NO_KERNEL is undefined case
254
256
  return False
255
257
  elif env_var_no_kernel not in ["True", "False"]:
256
- print(
257
- f"""
258
+ print(f"""
258
259
  The value of the 'NO_KERNEL' environment variable is {os.environ["NO_KERNEL"]}.
259
260
  The only valid values are True and False.
260
- """
261
- )
261
+ """)
262
262
  exit(1)
263
263
  else:
264
264
  return bool(env_var_no_kernel)
File without changes