Skip to content

Commit 825e77c

Browse files
committed
rename abx_pkg to abxpkg
1 parent 9cc3590 commit 825e77c

83 files changed

Lines changed: 2622 additions & 1687 deletions

Some content is hidden

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

AGENTS.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# abx-pkg Guide
1+
# abxpkg Guide
22

33
This is a python package and CLI tool to help install and run binary package dependencies from a variety
44
of providers (etc apt, brew, pip, npm, docker, env, bash script, etc.).
@@ -8,7 +8,7 @@ It provides nice safe pydantic type interfaces for `Binary`, `BinProvider`, `Sem
88
### Python API
99

1010
```python
11-
from abx_pkg import Binary, apt, brew, env, BinProvider
11+
from abxpkg import Binary, apt, brew, env, BinProvider
1212

1313
wget = env.load('wget') or apt.install('wget') or brew.install('wget')
1414

@@ -29,27 +29,27 @@ wget.uninstall()
2929
### CLI
3030

3131
```
32-
abx-pkg --version
33-
abx-pkg install --binproviders=env,apt,brew wget
34-
abx-pkg load|install|update|uninstall|run [--flags...] [binary] [args...]
32+
abxpkg --version
33+
abxpkg install --binproviders=env,apt,brew wget
34+
abxpkg load|install|update|uninstall|run [--flags...] [binary] [args...]
3535
3636
# abx alias cli:
37-
abx wget --version # just a thin wrapper around `abx-pkg run --install [--flags...] [binary] [args...]`
37+
abx wget --version # just a thin wrapper around `abxpkg run --install [--flags...] [binary] [args...]`
3838
```
3939

4040
also usable as a shebang in scripts similar to uv run -S, auto installs dependencies before running the script:
4141
```javascript
42-
#!/usr/bin/env abx-pkg run --script node --abort-on-uncaught-exception
42+
#!/usr/bin/env abxpkg run --script node --abort-on-uncaught-exception
4343
// /// script
4444
// dependencies = [
4545
// {name = "node", binproviders = ["env", "apt", "brew"], min_version: "22.0.0"},
4646
// {name = "playwright", binproviders = ["playwright", "pnpm", "npm", "yarn"]},
4747
// {name = "chromium", binproviders = ["env", "playwright", "puppeteer", "apt"], min_version: "146.0.0"},
4848
// ]
49-
// [tool.abx-pkg]
50-
// ABX_PKG_LIB_DIR=/tmp/abxlib
51-
// ABX_PKG_MIN_RELEASE_AGE=14
52-
// ABX_PKG_POSTINSTALL_SCRIPTS=False
49+
// [tool.abxpkg]
50+
// ABXPKG_LIB_DIR=/tmp/abxlib
51+
// ABXPKG_MIN_RELEASE_AGE=14
52+
// ABXPKG_POSTINSTALL_SCRIPTS=False
5353
// ///
5454

5555
import {playwright} from 'playwright';

README.md

Lines changed: 185 additions & 185 deletions
Large diffs are not rendered by default.

abx_pkg/settings.py

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__package__ = "abx_pkg"
1+
__package__ = "abxpkg"
22

33
from .base_types import (
44
BinName,
@@ -70,25 +70,25 @@
7070

7171
ALL_PROVIDERS = [
7272
EnvProvider,
73-
AptProvider,
73+
UvProvider,
74+
PipProvider,
75+
PnpmProvider,
76+
NpmProvider,
77+
YarnProvider,
78+
BunProvider,
7479
BrewProvider,
75-
CargoProvider,
7680
GemProvider,
7781
GoGetProvider,
82+
CargoProvider,
83+
PlaywrightProvider,
84+
PuppeteerProvider,
85+
AptProvider,
7886
NixProvider,
7987
DockerProvider,
80-
PipProvider,
81-
UvProvider,
82-
NpmProvider,
83-
PnpmProvider,
84-
YarnProvider,
85-
BunProvider,
8688
DenoProvider,
8789
AnsibleProvider,
8890
PyinfraProvider,
8991
ChromeWebstoreProvider,
90-
PuppeteerProvider,
91-
PlaywrightProvider,
9292
BashProvider,
9393
]
9494

@@ -189,7 +189,7 @@ def __getattr__(name: str):
189189
"PlaywrightProvider",
190190
"BashProvider",
191191
# Note: provider singleton names (apt, pip, brew, etc.) are intentionally
192-
# excluded from __all__ so that `from abx_pkg import *` does not eagerly
192+
# excluded from __all__ so that `from abxpkg import *` does not eagerly
193193
# instantiate every provider. Use explicit imports instead:
194-
# from abx_pkg import apt, pip, brew, npm, pnpm, yarn, bun, deno
194+
# from abxpkg import apt, pip, brew, npm, pnpm, yarn, bun, deno
195195
]
File renamed without changes.

abx_pkg/apps.py renamed to abxpkg/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class AbxPkgConfig(AppConfig):
55
default_auto_field = "django.db.models.BigAutoField"
6-
name = "abx_pkg"
6+
name = "abxpkg"
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__package__ = "abx_pkg"
1+
__package__ = "abxpkg"
22

33
import inspect
44
import os
@@ -14,32 +14,32 @@
1414

1515

1616
# Read once at import time. When set, providers that opt into
17-
# ``abx_pkg_install_root_default("<provider>")`` default their
18-
# ``install_root`` to ``ABX_PKG_LIB_DIR / <provider name>`` (e.g.
17+
# ``abxpkg_install_root_default("<provider>")`` default their
18+
# ``install_root`` to ``ABXPKG_LIB_DIR / <provider name>`` (e.g.
1919
# ``<lib>/npm``, ``<lib>/pip``, ``<lib>/gem``). Per-provider
20-
# ``ABX_PKG_<NAME>_ROOT`` env vars override this for their own
20+
# ``ABXPKG_<NAME>_ROOT`` env vars override this for their own
2121
# provider; explicit constructor kwargs override both.
2222
DEFAULT_LIB_DIR: Path = user_config_path("abx") / "lib"
2323

2424

25-
def abx_pkg_install_root_default(provider_name: str) -> Path | None:
25+
def abxpkg_install_root_default(provider_name: str) -> Path | None:
2626
"""Resolve a provider's default install root from env vars.
2727
2828
Precedence (most specific wins):
29-
1. ``ABX_PKG_<PROVIDER>_ROOT`` (e.g. ``ABX_PKG_NPM_ROOT``)
30-
2. ``ABX_PKG_LIB_DIR / <provider_name>``
29+
1. ``ABXPKG_<PROVIDER>_ROOT`` (e.g. ``ABXPKG_NPM_ROOT``)
30+
2. ``ABXPKG_LIB_DIR / <provider_name>``
3131
3. ``None`` — caller's built-in default applies.
3232
3333
Explicit constructor kwargs (``install_root=`` or the
3434
provider-specific alias) always override whatever this function
3535
returns.
3636
"""
37-
specific = os.environ.get(f"ABX_PKG_{provider_name.upper()}_ROOT", "").strip()
37+
specific = os.environ.get(f"ABXPKG_{provider_name.upper()}_ROOT", "").strip()
3838
if specific:
3939
return Path(specific).expanduser().resolve()
4040
# Read from os.environ directly (not the cached module-level
41-
# ABX_PKG_LIB_DIR) because the CLI sets it at runtime via --lib.
42-
lib_dir = os.environ.get("ABX_PKG_LIB_DIR", "").strip()
41+
# ABXPKG_LIB_DIR) because the CLI sets it at runtime via --lib.
42+
lib_dir = os.environ.get("ABXPKG_LIB_DIR", "").strip()
4343
if lib_dir:
4444
return Path(lib_dir).expanduser().resolve() / provider_name
4545
return None
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__package__ = "abx_pkg"
1+
__package__ = "abxpkg"
22

33
from typing import Any
44
from typing import Self
@@ -346,7 +346,7 @@ def load(
346346
assert self.name, f"No binary name was provided! {self}"
347347

348348
# if we're already loaded, skip loading
349-
if self.is_valid:
349+
if self.is_valid and not no_cache:
350350
logger.debug("Skipping load for %s because it is already valid", self.name)
351351
return self
352352

0 commit comments

Comments
 (0)