git-goose 0.3.0__tar.gz → 0.3.2__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 (57) hide show
  1. {git_goose-0.3.0 → git_goose-0.3.2}/PKG-INFO +2 -2
  2. {git_goose-0.3.0 → git_goose-0.3.2}/README.md +1 -1
  3. {git_goose-0.3.0 → git_goose-0.3.2}/src/git_goose.egg-info/PKG-INFO +2 -2
  4. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/__main__.py +23 -2
  5. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/_version.py +2 -2
  6. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/paths.py +10 -3
  7. {git_goose-0.3.0 → git_goose-0.3.2}/.dockerignore +0 -0
  8. {git_goose-0.3.0 → git_goose-0.3.2}/.editorconfig +0 -0
  9. {git_goose-0.3.0 → git_goose-0.3.2}/.github/dependabot.yml +0 -0
  10. {git_goose-0.3.0 → git_goose-0.3.2}/.github/workflows/ci.yaml +0 -0
  11. {git_goose-0.3.0 → git_goose-0.3.2}/.github/workflows/release.yaml +0 -0
  12. {git_goose-0.3.0 → git_goose-0.3.2}/.gitignore +0 -0
  13. {git_goose-0.3.0 → git_goose-0.3.2}/.goose/node/manifest.json +0 -0
  14. {git_goose-0.3.0 → git_goose-0.3.2}/.goose/node/package-lock.json +0 -0
  15. {git_goose-0.3.0 → git_goose-0.3.2}/.goose/node/package.json +0 -0
  16. {git_goose-0.3.0 → git_goose-0.3.2}/.goose/python/manifest.json +0 -0
  17. {git_goose-0.3.0 → git_goose-0.3.2}/.goose/python/requirements.txt +0 -0
  18. {git_goose-0.3.0 → git_goose-0.3.2}/.goose/type-check/manifest.json +0 -0
  19. {git_goose-0.3.0 → git_goose-0.3.2}/.goose/type-check/requirements.txt +0 -0
  20. {git_goose-0.3.0 → git_goose-0.3.2}/Dockerfile +0 -0
  21. {git_goose-0.3.0 → git_goose-0.3.2}/LICENSE +0 -0
  22. {git_goose-0.3.0 → git_goose-0.3.2}/Makefile +0 -0
  23. {git_goose-0.3.0 → git_goose-0.3.2}/goose.yaml +0 -0
  24. {git_goose-0.3.0 → git_goose-0.3.2}/pyproject.toml +0 -0
  25. {git_goose-0.3.0 → git_goose-0.3.2}/requirements.txt +0 -0
  26. {git_goose-0.3.0 → git_goose-0.3.2}/ruff.toml +0 -0
  27. {git_goose-0.3.0 → git_goose-0.3.2}/setup.cfg +0 -0
  28. {git_goose-0.3.0 → git_goose-0.3.2}/src/git_goose.egg-info/SOURCES.txt +0 -0
  29. {git_goose-0.3.0 → git_goose-0.3.2}/src/git_goose.egg-info/dependency_links.txt +0 -0
  30. {git_goose-0.3.0 → git_goose-0.3.2}/src/git_goose.egg-info/requires.txt +0 -0
  31. {git_goose-0.3.0 → git_goose-0.3.2}/src/git_goose.egg-info/top_level.txt +0 -0
  32. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/__init__.py +0 -0
  33. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/_utils/__init__.py +0 -0
  34. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/_utils/pydantic.py +0 -0
  35. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/asyncio.py +0 -0
  36. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/backend/__init__.py +0 -0
  37. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/backend/base.py +0 -0
  38. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/backend/index.py +0 -0
  39. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/backend/node.py +0 -0
  40. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/backend/python.py +0 -0
  41. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/config.py +0 -0
  42. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/context.py +0 -0
  43. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/environment.py +0 -0
  44. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/executable_unit.py +0 -0
  45. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/filter.py +0 -0
  46. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/git/__init__.py +0 -0
  47. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/git/shared.py +0 -0
  48. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/git/status.py +0 -0
  49. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/manifest.py +0 -0
  50. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/orphan_environments.py +0 -0
  51. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/parallel.py +0 -0
  52. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/process.py +0 -0
  53. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/py.typed +0 -0
  54. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/scheduler.py +0 -0
  55. {git_goose-0.3.0 → git_goose-0.3.2}/src/goose/targets.py +0 -0
  56. {git_goose-0.3.0 → git_goose-0.3.2}/tests/__init__.py +0 -0
  57. {git_goose-0.3.0 → git_goose-0.3.2}/tests/test_targets.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: git-goose
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: A picky and eager Git hook runner.
5
5
  Author-email: Anton Agestam <git@antonagestam.se>
6
6
  License: BSD 3-Clause
@@ -44,7 +44,7 @@ Requires-Dist: shellingham
44
44
  #### Docker alias
45
45
 
46
46
  ```sh
47
- alias goose='docker run --rm -it -v ${PWD}:/wd -v ~/.cache/goose-docker:/home/nonroot/.cache ghcr.io/antonagestam/goose:latest'
47
+ alias goose='docker run --rm -it -v ${PWD}:/wd -v ~/.cache/goose-docker:/home/nonroot/.cache -e "GOOSE_AUGMENTED_CWD=${PWD}" ghcr.io/antonagestam/goose:latest'
48
48
  ```
49
49
 
50
50
  #### Via PyPI
@@ -21,7 +21,7 @@
21
21
  #### Docker alias
22
22
 
23
23
  ```sh
24
- alias goose='docker run --rm -it -v ${PWD}:/wd -v ~/.cache/goose-docker:/home/nonroot/.cache ghcr.io/antonagestam/goose:latest'
24
+ alias goose='docker run --rm -it -v ${PWD}:/wd -v ~/.cache/goose-docker:/home/nonroot/.cache -e "GOOSE_AUGMENTED_CWD=${PWD}" ghcr.io/antonagestam/goose:latest'
25
25
  ```
26
26
 
27
27
  #### Via PyPI
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: git-goose
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: A picky and eager Git hook runner.
5
5
  Author-email: Anton Agestam <git@antonagestam.se>
6
6
  License: BSD 3-Clause
@@ -44,7 +44,7 @@ Requires-Dist: shellingham
44
44
  #### Docker alias
45
45
 
46
46
  ```sh
47
- alias goose='docker run --rm -it -v ${PWD}:/wd -v ~/.cache/goose-docker:/home/nonroot/.cache ghcr.io/antonagestam/goose:latest'
47
+ alias goose='docker run --rm -it -v ${PWD}:/wd -v ~/.cache/goose-docker:/home/nonroot/.cache -e "GOOSE_AUGMENTED_CWD=${PWD}" ghcr.io/antonagestam/goose:latest'
48
48
  ```
49
49
 
50
50
  #### Via PyPI
@@ -23,6 +23,7 @@ from goose.backend.base import RunResult
23
23
  from goose.config import EnvironmentId
24
24
  from goose.config import HookConfig
25
25
 
26
+ from . import __version__
26
27
  from .asyncio import asyncio_entrypoint
27
28
  from .context import gather_context
28
29
  from .environment import Environment
@@ -268,7 +269,7 @@ async def environment(
268
269
  environment = ctx.environments[EnvironmentId(selected_environment)]
269
270
  except KeyError:
270
271
  error_console.print("No such environment")
271
- raise SystemExit(1) from None
272
+ raise typer.Exit(1) from None
272
273
 
273
274
  print_environment(environment)
274
275
 
@@ -289,7 +290,7 @@ async def select(
289
290
  hook = next(hook for hook in ctx.config.hooks if hook.id == selected_hook)
290
291
  except StopIteration:
291
292
  error_console.print("No such hook.")
292
- raise SystemExit(1) from None
293
+ raise typer.Exit(1) from None
293
294
 
294
295
  if not hook.parameterize:
295
296
  error_console.print(
@@ -329,5 +330,25 @@ async def git_hook(
329
330
  hook_path.chmod(0o755)
330
331
 
331
332
 
333
+ def version_callback(print_version: bool) -> None:
334
+ if not print_version:
335
+ return
336
+ print(f"goose version {__version__}")
337
+ raise typer.Exit()
338
+
339
+
340
+ @cli.callback()
341
+ def main(
342
+ version: bool = typer.Option(
343
+ None,
344
+ "--version",
345
+ callback=version_callback,
346
+ is_eager=True,
347
+ help="Print version information.",
348
+ ),
349
+ ) -> None:
350
+ pass
351
+
352
+
332
353
  if __name__ == "__main__":
333
354
  cli()
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.3.0'
16
- __version_tuple__ = version_tuple = (0, 3, 0)
15
+ __version__ = version = '0.3.2'
16
+ __version_tuple__ = version_tuple = (0, 3, 2)
@@ -13,10 +13,17 @@ def _get_base_envs_path() -> Path:
13
13
  return _get_cache_home() / "goose"
14
14
 
15
15
 
16
+ def _get_working_directory_hash() -> str:
17
+ if (virtual_cwd := os.environ.get("GOOSE_AUGMENTED_CWD", None)) is not None:
18
+ cwd = virtual_cwd.encode()
19
+ else:
20
+ cwd = bytes(Path(os.getcwd()).resolve())
21
+ return hashlib.sha256(cwd).hexdigest()
22
+
23
+
16
24
  def get_env_path() -> Path:
17
25
  base_path = _get_base_envs_path()
18
- cwd = Path(os.getcwd()).resolve()
19
- env_hash = hashlib.sha256(bytes(cwd))
20
- env_path = base_path / env_hash.hexdigest()
26
+ cwd_hash = _get_working_directory_hash()
27
+ env_path = base_path / cwd_hash
21
28
  env_path.mkdir(exist_ok=True, parents=True)
22
29
  return env_path
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