Skip to content

Commit b9721c2

Browse files
committed
Add --keep, dep on newer twine
1 parent 9c8160e commit b9721c2

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

requirements-dev.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ black==24.3.0
22
coverage==7.4.0
33
flake8==7.0.0
44
mypy==1.8.0
5+
setuptools==80.7.1
56
tox==4.12.0
6-
twine==4.0.2
7-
volatile==2.1.0
8-
wheel==0.42.0
7+
twine==6.1.0
98
ufmt==2.3.0
109
usort==1.0.7
10+
volatile==2.1.0
11+
wheel==0.42.0

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ setup_requires =
1616
python_requires = >=3.11
1717
install_requires =
1818
setuptools >= 38.3.0
19+
twine >= 6.0.0
1920

2021
[options.entry_points]
2122
console_scripts =

squatter/__main__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ def cli() -> None: # pragma: no cover
1212

1313

1414
@cli.command(help="Generate a package")
15+
@click.option(
16+
"--keep", is_flag=True, default=False, help="Do not delete temp dir"
17+
)
1518
@click.option(
1619
"--upload", is_flag=True, default=False, help="Whether to invoke twine upload"
1720
)
@@ -21,11 +24,13 @@ def cli() -> None: # pragma: no cover
2124
)
2225
@click.argument("package_name")
2326
def generate(
24-
package_name: str, upload: bool, author: Optional[str], author_email: Optional[str]
27+
package_name: str, upload: bool, keep: bool, author: Optional[str], author_email: Optional[str]
2528
) -> None:
2629
# TODO flag for delete
27-
with tempfile.TemporaryDirectory(prefix=package_name) as d:
30+
with tempfile.TemporaryDirectory(prefix=package_name, delete=not keep) as d:
2831
env = Env(d)
32+
if keep:
33+
print("Generating in", d)
2934
env.generate(
3035
package_name=package_name, author=author, author_email=author_email
3136
)

0 commit comments

Comments
 (0)