quickpub 0.8.2__tar.gz → 0.8.3__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.
Files changed (36) hide show
  1. {quickpub-0.8.2/quickpub.egg-info → quickpub-0.8.3}/PKG-INFO +2 -2
  2. {quickpub-0.8.2 → quickpub-0.8.3}/README.md +1 -1
  3. {quickpub-0.8.2 → quickpub-0.8.3}/pyproject.toml +1 -1
  4. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/__main__.py +3 -4
  5. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/files.py +10 -6
  6. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/proxy.py +3 -2
  7. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/common_check.py +6 -8
  8. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/implementations/mypy.py +9 -3
  9. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/implementations/pylint.py +9 -5
  10. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/implementations/unittest.py +2 -3
  11. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/structures/additional_configuration.py +2 -3
  12. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/validators.py +3 -4
  13. {quickpub-0.8.2 → quickpub-0.8.3/quickpub.egg-info}/PKG-INFO +2 -2
  14. {quickpub-0.8.2 → quickpub-0.8.3}/LICENSE +0 -0
  15. {quickpub-0.8.2 → quickpub-0.8.3}/MANIFEST.in +0 -0
  16. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/__init__.py +0 -0
  17. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/classifiers.py +0 -0
  18. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/custom_types.py +0 -0
  19. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/enforcers.py +0 -0
  20. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/functions.py +0 -0
  21. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/py.typed +0 -0
  22. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/__init__.py +0 -0
  23. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/configurable.py +0 -0
  24. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/has_optional_executable.py +0 -0
  25. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/implementations/__init__.py +0 -0
  26. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/implementations/pytest.py +0 -0
  27. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/runnables/runnable.py +0 -0
  28. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/structures/__init__.py +0 -0
  29. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/structures/bound.py +0 -0
  30. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub/structures/version.py +0 -0
  31. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub.egg-info/SOURCES.txt +0 -0
  32. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub.egg-info/dependency_links.txt +0 -0
  33. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub.egg-info/requires.txt +0 -0
  34. {quickpub-0.8.2 → quickpub-0.8.3}/quickpub.egg-info/top_level.txt +0 -0
  35. {quickpub-0.8.2 → quickpub-0.8.3}/setup.cfg +0 -0
  36. {quickpub-0.8.2 → quickpub-0.8.3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quickpub
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Summary: A python package to quickly configure and publish a new package
5
5
  Author-email: danielnachumdev <danielnachumdev@gmail.com>
6
6
  License: MIT License
@@ -34,7 +34,7 @@ Requires-Python: >=3.8.0
34
34
  Description-Content-Type: text/markdown
35
35
  License-File: LICENSE
36
36
 
37
- # quickpub
37
+ # quickpub V0.8.3
38
38
  **Tested python versions**: `3.8.0`, `3.9.0`, `3.10.13`,
39
39
 
40
40
  Example usage of how this package was published
@@ -1,4 +1,4 @@
1
- # quickpub
1
+ # quickpub V0.8.3
2
2
  **Tested python versions**: `3.8.0`, `3.9.0`, `3.10.13`,
3
3
 
4
4
  Example usage of how this package was published
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quickpub"
7
- version = "0.8.2"
7
+ version = "0.8.3"
8
8
  authors = [
9
9
  { name = "danielnachumdev", email = "danielnachumdev@gmail.com" },
10
10
  ]
@@ -1,6 +1,5 @@
1
- from typing import Optional, Union
1
+ from typing import Optional, Union, List
2
2
  from danielutils import warning, file_exists
3
- from danielutils.versioned_imports import t_list
4
3
  from .validators import validate_version, validate_python_version, validate_keywords, validate_dependencies, \
5
4
  validate_source
6
5
  from .functions import build, upload, commit, metrics
@@ -25,8 +24,8 @@ def publish(
25
24
 
26
25
  min_python: Optional[Union[Version, str]] = None,
27
26
 
28
- keywords: Optional[t_list[str]] = None,
29
- dependencies: Optional[t_list[str]] = None,
27
+ keywords: Optional[List[str]] = None,
28
+ dependencies: Optional[List[str]] = None,
30
29
  config: Optional[AdditionalConfiguration] = None
31
30
  ) -> None:
32
31
  """The main function of this package. will do all the heavy lifting in order for you to publish your package.
@@ -1,8 +1,9 @@
1
+ from typing import List
2
+ from danielutils import get_files
1
3
  from .custom_types import Path
2
4
  from .classifiers import Classifier
3
5
  from .structures import Version
4
- from danielutils import get_files
5
- from danielutils.versioned_imports import t_list
6
+
6
7
 
7
8
  def create_toml(
8
9
  *,
@@ -15,10 +16,10 @@ def create_toml(
15
16
  author_email: str,
16
17
  description: str,
17
18
  homepage: str,
18
- keywords: t_list[str],
19
+ keywords: List[str],
19
20
  min_python: Version,
20
- dependencies: t_list[str],
21
- classifiers: t_list[Classifier]
21
+ dependencies: List[str],
22
+ classifiers: List[Classifier]
22
23
  ) -> None:
23
24
  classifiers_string = ",\n\t".join([f"\"{str(c)}\"" for c in classifiers])
24
25
  if len(classifiers_string) > 0:
@@ -63,10 +64,13 @@ packages = ["{name}"]
63
64
  def create_setup() -> None:
64
65
  with open("./setup.py", "w", encoding="utf8") as f:
65
66
  f.write("from setuptools import setup\n\nsetup()\n")
66
- def create_manifest(*,name:str)->None:
67
+
68
+
69
+ def create_manifest(*, name: str) -> None:
67
70
  with open("./MANIFEST.in", "w", encoding="utf8") as f:
68
71
  f.write(f"recursive-include {name} *.py")
69
72
 
73
+
70
74
  __all__ = [
71
75
  "create_setup",
72
76
  "create_toml"
@@ -1,9 +1,10 @@
1
1
  import danielutils
2
2
  import requests
3
- from danielutils.versioned_imports import t_tuple
3
+ from typing import Tuple
4
+
4
5
 
5
6
  # need it like this for the testing
6
- def cm(*args, **kwargs) -> t_tuple[int, bytes, bytes]:
7
+ def cm(*args, **kwargs) -> Tuple[int, bytes, bytes]:
7
8
  return danielutils.cm(*args, **kwargs)
8
9
 
9
10
 
@@ -1,8 +1,7 @@
1
1
  from abc import abstractmethod
2
- from typing import Optional, Union
2
+ from typing import Optional, Union, List
3
3
 
4
4
  from danielutils import cm, info
5
- from danielutils.versioned_imports import t_list
6
5
 
7
6
  from .has_optional_executable import HasOptionalExecutable
8
7
  from .runnable import Runnable
@@ -20,12 +19,9 @@ class CommonCheck(Runnable, Configurable, HasOptionalExecutable):
20
19
  self.bound: Bound = bound if isinstance(bound, Bound) else Bound.from_string(bound)
21
20
  self.target = target
22
21
 
22
+ @abstractmethod
23
23
  def _build_command(self, target: str) -> str:
24
- command: str = self.get_executable()
25
- if self.has_config:
26
- command += f" --rcfile {self.config_path}"
27
- command += f" {target}"
28
- return command
24
+ ...
29
25
 
30
26
  def _pre_command(self):
31
27
  pass
@@ -42,12 +38,14 @@ class CommonCheck(Runnable, Configurable, HasOptionalExecutable):
42
38
  score = self._calculate_score(ret, b"".join([out, err]).decode("utf-8").splitlines())
43
39
  from ..enforcers import exit_if
44
40
  exit_if(not self.bound.compare_against(score), f"{self.name} failed to pass it's defined bound")
41
+ except Exception as e:
42
+ raise RuntimeError(f"Failed to run {self.name}, try running manually:\n{self._build_command('TARGET')}") from e
45
43
  finally:
46
44
  self._post_command()
47
45
 
48
46
 
49
47
  @abstractmethod
50
- def _calculate_score(self, ret: int, command_output: t_list[str]) -> float: ...
48
+ def _calculate_score(self, ret: int, command_output: List[str]) -> float: ...
51
49
 
52
50
 
53
51
  __all__ = [
@@ -1,17 +1,23 @@
1
1
  import re
2
- from typing import Optional
3
- from danielutils.versioned_imports import t_list
2
+ from typing import Optional, List
4
3
  from ..common_check import CommonCheck
5
4
 
6
5
 
7
6
  class MypyRunner(CommonCheck):
7
+ def _build_command(self, target: str) -> str:
8
+ command: str = self.get_executable()
9
+ if self.has_config:
10
+ command += f" --config-file {self.config_path}"
11
+ command += f" {target}"
12
+ return command
13
+
8
14
  RATING_PATTERN: re.Pattern = re.compile(r".*?([\d\.\/]+)")
9
15
 
10
16
  def __init__(self, bound: str = "<15", configuration_path: Optional[str] = None,
11
17
  executable_path: Optional[str] = None) -> None:
12
18
  CommonCheck.__init__(self, "mypy", bound, configuration_path, executable_path)
13
19
 
14
- def _calculate_score(self, ret, lines: t_list[str]) -> float:
20
+ def _calculate_score(self, ret, lines: List[str]) -> float:
15
21
  from ...enforcers import exit_if
16
22
  rating_line = lines[-1]
17
23
  exit_if(not (m := self.RATING_PATTERN.match(rating_line)),
@@ -1,17 +1,21 @@
1
1
  import re
2
- from typing import Optional
3
- from danielutils.versioned_imports import t_list
2
+ from typing import Optional, List
4
3
  from ..common_check import CommonCheck
5
4
 
6
5
 
7
6
  class PylintRunner(CommonCheck):
7
+ RATING_PATTERN: re.Pattern = re.compile(r".*?([\d\.\/]+)")
8
8
  def __init__(self, bound: str = ">=0.8", configuration_path: Optional[str] = None,
9
9
  executable_path: Optional[str] = None) -> None:
10
10
  CommonCheck.__init__(self, "pylint", bound, configuration_path, executable_path)
11
11
 
12
- RATING_PATTERN: re.Pattern = re.compile(r".*?([\d\.\/]+)")
13
-
14
- def _calculate_score(self, ret: int, lines: t_list[str]) -> float:
12
+ def _build_command(self, target: str) -> str:
13
+ command: str = self.get_executable()
14
+ if self.has_config:
15
+ command += f" --rcfile {self.config_path}"
16
+ command += f" {target}"
17
+ return command
18
+ def _calculate_score(self, ret: int, lines: List[str]) -> float:
15
19
  from ...enforcers import exit_if
16
20
  rating_line = lines[-2]
17
21
  exit_if(not (m := self.RATING_PATTERN.match(rating_line)),
@@ -1,8 +1,7 @@
1
1
  import re
2
2
  import os
3
- from typing import Optional
3
+ from typing import Optional, List
4
4
  from danielutils import get_current_working_directory, set_current_working_directory
5
- from danielutils.versioned_imports import t_list
6
5
  from ..common_check import CommonCheck
7
6
 
8
7
 
@@ -26,7 +25,7 @@ class UnittestRunner(CommonCheck):
26
25
  command += f" discover -s {rel}"
27
26
  return command # f"cd {self.target}; {command}" # f"; cd {self.target}"
28
27
 
29
- def _calculate_score(self, ret: int, lines: t_list[str]) -> float:
28
+ def _calculate_score(self, ret: int, lines: List[str]) -> float:
30
29
  from ...enforcers import exit_if
31
30
  num_tests_line = lines[-3]
32
31
  num_failed_line = lines[-1] if lines[-1] != "OK" else "0"
@@ -1,12 +1,11 @@
1
1
  from dataclasses import dataclass
2
- from typing import Optional
3
- from danielutils.versioned_imports import t_list
2
+ from typing import Optional, List
4
3
  from ..runnables import Runnable
5
4
 
6
5
 
7
6
  @dataclass(frozen=True)
8
7
  class AdditionalConfiguration:
9
- runners: Optional[t_list[Runnable]]
8
+ runners: Optional[List[Runnable]]
10
9
 
11
10
 
12
11
  __all__ = [
@@ -1,7 +1,6 @@
1
- from typing import Optional, Union
1
+ from typing import Optional, Union, List
2
2
 
3
3
  from danielutils import get_python_version
4
- from danielutils.versioned_imports import t_list
5
4
  from .custom_types import Path
6
5
  from .structures import Version
7
6
 
@@ -20,13 +19,13 @@ def validate_python_version(min_python: Optional[Version]) -> Version:
20
19
  return Version(*get_python_version())
21
20
 
22
21
 
23
- def validate_keywords(keywords: Optional[t_list[str]]) -> t_list[str]:
22
+ def validate_keywords(keywords: Optional[List[str]]) -> List[str]:
24
23
  if keywords is None:
25
24
  return []
26
25
  return keywords
27
26
 
28
27
 
29
- def validate_dependencies(dependencies: Optional[t_list[str]]) -> t_list[str]:
28
+ def validate_dependencies(dependencies: Optional[List[str]]) -> List[str]:
30
29
  if dependencies is None:
31
30
  return []
32
31
  return dependencies
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quickpub
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Summary: A python package to quickly configure and publish a new package
5
5
  Author-email: danielnachumdev <danielnachumdev@gmail.com>
6
6
  License: MIT License
@@ -34,7 +34,7 @@ Requires-Python: >=3.8.0
34
34
  Description-Content-Type: text/markdown
35
35
  License-File: LICENSE
36
36
 
37
- # quickpub
37
+ # quickpub V0.8.3
38
38
  **Tested python versions**: `3.8.0`, `3.9.0`, `3.10.13`,
39
39
 
40
40
  Example usage of how this package was published
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes