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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pysfi
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Single File commands for Interactive python.
5
5
  Requires-Python: >=3.8
6
6
  Requires-Dist: tomli>=2.4.0; python_version < '3.11'
@@ -8,7 +8,7 @@ description = "Single File commands for Interactive python."
8
8
  name = "pysfi"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
11
- version = "0.1.3"
11
+ version = "0.1.4"
12
12
 
13
13
  [project.scripts]
14
14
  alarmclk = "sfi.alarmclock.alarmclock:main"
@@ -1,3 +1,3 @@
1
1
  """Single File commands for Interactive python."""
2
2
 
3
- __version__ = "0.1.3"
3
+ __version__ = "0.1.4"
@@ -1,3 +1,3 @@
1
1
  """Bumpversion - Automated version number management tool."""
2
2
 
3
- __version__ = "0.1.3"
3
+ __version__ = "0.1.4"
@@ -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
- username = __token__
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) -> None:
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
- if not token_found:
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