quickpub 0.8.2__tar.gz → 0.8.31__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.
- {quickpub-0.8.2/quickpub.egg-info → quickpub-0.8.31}/PKG-INFO +2 -2
- {quickpub-0.8.2 → quickpub-0.8.31}/README.md +1 -1
- {quickpub-0.8.2 → quickpub-0.8.31}/pyproject.toml +1 -1
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/__main__.py +3 -4
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/files.py +10 -6
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/proxy.py +3 -2
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/common_check.py +8 -9
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/implementations/mypy.py +11 -4
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/implementations/pylint.py +12 -5
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/implementations/unittest.py +3 -4
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/structures/additional_configuration.py +2 -3
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/validators.py +3 -4
- {quickpub-0.8.2 → quickpub-0.8.31/quickpub.egg-info}/PKG-INFO +2 -2
- {quickpub-0.8.2 → quickpub-0.8.31}/LICENSE +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/MANIFEST.in +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/__init__.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/classifiers.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/custom_types.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/enforcers.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/functions.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/py.typed +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/__init__.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/configurable.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/has_optional_executable.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/implementations/__init__.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/implementations/pytest.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/runnables/runnable.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/structures/__init__.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/structures/bound.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub/structures/version.py +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub.egg-info/SOURCES.txt +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub.egg-info/dependency_links.txt +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub.egg-info/requires.txt +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/quickpub.egg-info/top_level.txt +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/setup.cfg +0 -0
- {quickpub-0.8.2 → quickpub-0.8.31}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: quickpub
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.31
|
|
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,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[
|
|
29
|
-
dependencies: Optional[
|
|
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
|
-
|
|
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:
|
|
19
|
+
keywords: List[str],
|
|
19
20
|
min_python: Version,
|
|
20
|
-
dependencies:
|
|
21
|
-
classifiers:
|
|
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
|
-
|
|
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
|
|
3
|
+
from typing import Tuple
|
|
4
|
+
|
|
4
5
|
|
|
5
6
|
# need it like this for the testing
|
|
6
|
-
def cm(*args, **kwargs) ->
|
|
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
|
|
@@ -12,7 +11,7 @@ from ..structures import Bound
|
|
|
12
11
|
|
|
13
12
|
class CommonCheck(Runnable, Configurable, HasOptionalExecutable):
|
|
14
13
|
|
|
15
|
-
def __init__(self, name: str, bound: Union[str, Bound], target: Optional[str] = None,
|
|
14
|
+
def __init__(self, *, name: str, bound: Union[str, Bound], target: Optional[str] = None,
|
|
16
15
|
configuration_path: Optional[str] = None,
|
|
17
16
|
executable_path: Optional[str] = None) -> None:
|
|
18
17
|
Configurable.__init__(self, configuration_path)
|
|
@@ -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
|
-
|
|
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,15 @@ 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(
|
|
43
|
+
f"Failed to run {self.name}, try running manually:\n{self._build_command('TARGET')}") from e
|
|
45
44
|
finally:
|
|
46
45
|
self._post_command()
|
|
47
46
|
|
|
48
47
|
|
|
49
48
|
@abstractmethod
|
|
50
|
-
def _calculate_score(self, ret: int, command_output:
|
|
49
|
+
def _calculate_score(self, ret: int, command_output: List[str]) -> float: ...
|
|
51
50
|
|
|
52
51
|
|
|
53
52
|
__all__ = [
|
|
@@ -1,17 +1,24 @@
|
|
|
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
|
-
CommonCheck.__init__(self, "mypy", bound, configuration_path,
|
|
18
|
+
CommonCheck.__init__(self, name="mypy", bound=bound, configuration_path=configuration_path,
|
|
19
|
+
executable_path=executable_path)
|
|
13
20
|
|
|
14
|
-
def _calculate_score(self, ret, lines:
|
|
21
|
+
def _calculate_score(self, ret, lines: List[str]) -> float:
|
|
15
22
|
from ...enforcers import exit_if
|
|
16
23
|
rating_line = lines[-1]
|
|
17
24
|
exit_if(not (m := self.RATING_PATTERN.match(rating_line)),
|
|
@@ -1,17 +1,24 @@
|
|
|
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
9
|
def __init__(self, bound: str = ">=0.8", configuration_path: Optional[str] = None,
|
|
9
10
|
executable_path: Optional[str] = None) -> None:
|
|
10
|
-
CommonCheck.__init__(self, "pylint", bound, configuration_path,
|
|
11
|
+
CommonCheck.__init__(self, name="pylint", bound=bound, configuration_path=configuration_path,
|
|
12
|
+
executable_path=executable_path)
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
def _build_command(self, target: str) -> str:
|
|
15
|
+
command: str = self.get_executable()
|
|
16
|
+
if self.has_config:
|
|
17
|
+
command += f" --rcfile {self.config_path}"
|
|
18
|
+
command += f" {target}"
|
|
19
|
+
return command
|
|
13
20
|
|
|
14
|
-
def _calculate_score(self, ret: int, lines:
|
|
21
|
+
def _calculate_score(self, ret: int, lines: List[str]) -> float:
|
|
15
22
|
from ...enforcers import exit_if
|
|
16
23
|
rating_line = lines[-2]
|
|
17
24
|
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
|
|
|
@@ -17,7 +16,7 @@ class UnittestRunner(CommonCheck):
|
|
|
17
16
|
RATING_PATTERN: re.Pattern = re.compile(r".*?([\d\.\/]+)")
|
|
18
17
|
|
|
19
18
|
def __init__(self, target: Optional[str] = "./tests", bound: str = ">=0.8") -> None:
|
|
20
|
-
CommonCheck.__init__(self, "unittest", bound, target)
|
|
19
|
+
CommonCheck.__init__(self, name="unittest", bound=bound, target=target)
|
|
21
20
|
self._cwd = ""
|
|
22
21
|
|
|
23
22
|
def _build_command(self, src: str, *args) -> str:
|
|
@@ -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:
|
|
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[
|
|
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[
|
|
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[
|
|
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.
|
|
3
|
+
Version: 0.8.31
|
|
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
|
|
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
|