pysfi 0.1.3__tar.gz → 0.1.4__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.
- {pysfi-0.1.3 → pysfi-0.1.4}/PKG-INFO +1 -1
- {pysfi-0.1.3 → pysfi-0.1.4}/pyproject.toml +1 -1
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/__init__.py +1 -1
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/bumpversion/__init__.py +1 -1
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/makepython/makepython.py +9 -27
- {pysfi-0.1.3 → pysfi-0.1.4}/.gitignore +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/README.md +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/alarmclock/__init__.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/alarmclock/alarmclock.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/bumpversion/README.md +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/bumpversion/bumpversion.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/bumpversion/tests/__init__.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/bumpversion/tests/test_bumpversion.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/embedinstall/embedinstall.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/filedate/README.md +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/filedate/__init__.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/filedate/filedate.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/makepython/__init__.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/projectparse/projectparse.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/pyloadergen/pyloadergen.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/pyloadergen/tests/__init__.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/pyloadergen/tests/test_pyloadergen.py +0 -0
- {pysfi-0.1.3 → pysfi-0.1.4}/sfi/pypacker/fspacker.py +0 -0
|
@@ -87,6 +87,7 @@ class Command:
|
|
|
87
87
|
|
|
88
88
|
_COMMANDS = [
|
|
89
89
|
Command(name="build", alias="b"),
|
|
90
|
+
Command(name="bumpversion", alias="bump"),
|
|
90
91
|
Command(name="clean", alias="c"),
|
|
91
92
|
Command(name="install", alias="i"),
|
|
92
93
|
Command(name="dev", alias="d"),
|
|
@@ -110,8 +111,11 @@ def main():
|
|
|
110
111
|
logger.info(f"Using build command: {build_command}")
|
|
111
112
|
if args.command in {"build", "b"}:
|
|
112
113
|
_run_command([build_command, "build"], cwd)
|
|
114
|
+
elif args.command in {"bump", "bumpversion"}:
|
|
115
|
+
_run_command(["bumpversion", "patch"], cwd)
|
|
113
116
|
if args.command in {"publish", "p"}:
|
|
114
|
-
_check_pypi_token(build_command)
|
|
117
|
+
if not _check_pypi_token(build_command):
|
|
118
|
+
_set_token(build_command)
|
|
115
119
|
_run_command([build_command, "publish"], cwd)
|
|
116
120
|
if args.command in {"token", "tk"}:
|
|
117
121
|
_set_token(build_command)
|
|
@@ -166,23 +170,17 @@ def _set_poetry_token(token: str) -> None:
|
|
|
166
170
|
|
|
167
171
|
def _set_hatch_token(token: str) -> None:
|
|
168
172
|
"""Set PyPI token for hatch."""
|
|
169
|
-
_write_to_env_file("TWINE_USERNAME", "__token__")
|
|
170
|
-
_write_to_env_file("TWINE_PASSWORD", token)
|
|
171
|
-
|
|
172
173
|
pypirc_path = Path.home() / ".pypirc"
|
|
173
174
|
pypirc_content = f"""[pypi]
|
|
174
|
-
|
|
175
|
-
password = {token}
|
|
176
|
-
|
|
177
|
-
[testpypi]
|
|
175
|
+
repository = https://upload.pypi.org/legacy/
|
|
178
176
|
username = __token__
|
|
179
177
|
password = {token}
|
|
180
178
|
"""
|
|
181
179
|
pypirc_path.write_text(pypirc_content)
|
|
182
180
|
logger.info(f"Token saved to {pypirc_path}")
|
|
183
181
|
|
|
184
|
-
|
|
185
|
-
def _check_pypi_token(build_command: str) ->
|
|
182
|
+
|
|
183
|
+
def _check_pypi_token(build_command: str) -> bool:
|
|
186
184
|
"""Check if PyPI token is configured before publishing."""
|
|
187
185
|
logger.info("Checking PyPI token configuration...")
|
|
188
186
|
|
|
@@ -219,29 +217,13 @@ def _check_pypi_token(build_command: str) -> None:
|
|
|
219
217
|
token_found = True
|
|
220
218
|
|
|
221
219
|
elif build_command == "hatch":
|
|
222
|
-
# Check for hatch token
|
|
223
|
-
if os.getenv("HATCH_INDEX_USER") and os.getenv("HATCH_INDEX_AUTH"):
|
|
224
|
-
logger.info("Found PyPI credentials in HATCH environment variables")
|
|
225
|
-
token_found = True
|
|
226
|
-
|
|
227
|
-
# Check for twine/PyPI token
|
|
228
|
-
token_env_vars = ["TWINE_USERNAME", "TWINE_PASSWORD", "PYPI_TOKEN"]
|
|
229
|
-
for var in token_env_vars:
|
|
230
|
-
if os.getenv(var):
|
|
231
|
-
logger.info(f"Found PyPI token in environment variable: {var}")
|
|
232
|
-
token_found = True
|
|
233
|
-
break
|
|
234
|
-
|
|
235
220
|
# Check for .pypirc
|
|
236
221
|
pypirc_path = Path.home() / ".pypirc"
|
|
237
222
|
if pypirc_path.exists():
|
|
238
223
|
logger.info(f"Found .pypirc file: {pypirc_path}")
|
|
239
224
|
token_found = True
|
|
240
225
|
|
|
241
|
-
|
|
242
|
-
logger.warning("No PyPI token found!")
|
|
243
|
-
logger.info("Let's set it up now...")
|
|
244
|
-
_set_token(build_command, show_header=False)
|
|
226
|
+
return token_found
|
|
245
227
|
|
|
246
228
|
|
|
247
229
|
def _run_command(cmd: list[str], directory: Path) -> None:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|