fast-dev-cli 0.25.3__tar.gz → 0.25.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.1
2
2
  Name: fast-dev-cli
3
- Version: 0.25.3
3
+ Version: 0.25.4
4
4
  Summary: Python project development tool.
5
5
  Author-Email: Waket Zheng <waketzheng@gmail.com>>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -0,0 +1 @@
1
+ __version__ = "0.25.4"
@@ -1658,6 +1658,16 @@ def coverage_test(
1658
1658
  return test(dry, ignore_script)
1659
1659
 
1660
1660
 
1661
+ def _not_a_distribution() -> bool:
1662
+ with contextlib.suppress(FileNotFoundError, KeyError, EnvError):
1663
+ toml_text = Project.load_toml_text()
1664
+ doc = tomllib.loads(toml_text)
1665
+ match doc["build-system"]["build-backend"]:
1666
+ case "pdm.backend":
1667
+ return doc.get("tool", {}).get("pdm", {}).get("distribution") is False
1668
+ return True
1669
+
1670
+
1661
1671
  class Publish:
1662
1672
  class CommandEnum(StrEnum):
1663
1673
  poetry = "poetry publish --build"
@@ -1673,6 +1683,12 @@ class Publish:
1673
1683
  if tool == "uv":
1674
1684
  envs = ["UV_PUBLISH_INDEX", "UV_PUBLISH_URL", "UV_PUBLISH_TOKEN"]
1675
1685
  if not any(os.getenv(i) for i in envs):
1686
+ if _not_a_distribution():
1687
+ if verbose:
1688
+ yellow_warn(
1689
+ "Skip uv publish as project is not distribution"
1690
+ )
1691
+ return "fast version"
1676
1692
  if verbose:
1677
1693
  yellow_warn(f"Skip uv publish as envs ({envs}) not set")
1678
1694
  return "uv build"
@@ -29,7 +29,7 @@ dependencies = [
29
29
  "typer>=0.24.0,<1",
30
30
  "tomli >=2.0.1,<3; python_version < '3.11'",
31
31
  ]
32
- version = "0.25.3"
32
+ version = "0.25.4"
33
33
 
34
34
  [project.urls]
35
35
  Homepage = "https://github.com/waketzheng/fast-dev-cli"
@@ -1 +0,0 @@
1
- __version__ = "0.25.3"
File without changes
File without changes