procure 0.1.0__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.
@@ -0,0 +1,80 @@
1
+ /target
2
+
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ .pytest_cache/
6
+ *.py[cod]
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ .venv/
14
+ env/
15
+ bin/
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ include/
26
+ man/
27
+ venv/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+
32
+ # Installer logs
33
+ pip-log.txt
34
+ pip-delete-this-directory.txt
35
+ pip-selfcheck.json
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .coverage
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+
45
+ # Translations
46
+ *.mo
47
+
48
+ # Mr Developer
49
+ .mr.developer.cfg
50
+ .project
51
+ .pydevproject
52
+
53
+ # Rope
54
+ .ropeproject
55
+
56
+ # Django stuff:
57
+ *.log
58
+ *.pot
59
+
60
+ .DS_Store
61
+
62
+ # Sphinx documentation
63
+ docs/_build/
64
+
65
+ # PyCharm
66
+ .idea/
67
+
68
+ # VSCode
69
+ .vscode/
70
+
71
+ # Pyenv
72
+ .python-version
73
+
74
+ # envrc
75
+ .envrc
76
+
77
+ # More
78
+ tmp
79
+ temp
80
+ depot
@@ -0,0 +1,10 @@
1
+ # Procure :pinched_fingers: Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2023-04-06
9
+ ### Added
10
+ - Everything
procure-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Kurtis Fields
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
procure-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.1
2
+ Name: procure
3
+ Version: 0.1.0
4
+ Summary: Procure build assets
5
+ Project-URL: homepage, https://github.com/crungelab/procure
6
+ Project-URL: documentation, https://crungelab.github.io/procure/
7
+ Project-URL: repository, https://github.com/crungelab/procure
8
+ Project-URL: changelog, https://github.com/crungelab/procure/blob/main/CHANGELOG.md
9
+ Author-email: Kurtis Fields <kurtisfields@gmail.com>
10
+ License: MIT License
11
+
12
+ Copyright (c) 2022 Kurtis Fields
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Programming Language :: Python
34
+ Classifier: Programming Language :: Python :: 3.8
35
+ Classifier: Programming Language :: Python :: 3.9
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: Implementation :: CPython
39
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
40
+ Requires-Python: >=3.8
41
+ Requires-Dist: click==8.1.3
42
+ Provides-Extra: dev
43
+ Requires-Dist: black~=22.12.0; extra == 'dev'
44
+ Provides-Extra: test
45
+ Requires-Dist: pytest~=7.2.1; extra == 'test'
46
+ Description-Content-Type: text/markdown
47
+
48
+ # Procure :pinched_fingers:
49
+
50
+ Python utility for procuring git repositories etc ...
@@ -0,0 +1,3 @@
1
+ # Procure :pinched_fingers:
2
+
3
+ Python utility for procuring git repositories etc ...
@@ -0,0 +1,9 @@
1
+ from procure import GitSolution
2
+
3
+ class AwesomePython(GitSolution):
4
+ path = 'depot/awesome-python'
5
+ url = 'https://github.com/vinta/awesome-python'
6
+
7
+ solutions = [
8
+ AwesomePython,
9
+ ]
@@ -0,0 +1 @@
1
+ __version__ = '0.1.0'
@@ -0,0 +1 @@
1
+ from .solution import GitSolution
@@ -0,0 +1,36 @@
1
+ import os
2
+ import importlib.util
3
+ from pathlib import Path
4
+
5
+ import click
6
+
7
+
8
+ @click.group(invoke_without_command=True)
9
+ @click.pass_context
10
+ def cli(ctx):
11
+ ctx.ensure_object(dict)
12
+ if ctx.invoked_subcommand is None:
13
+ update()
14
+
15
+
16
+ @cli.command()
17
+ @click.pass_context
18
+ def update(ctx):
19
+ #print('update')
20
+ global dot_procure
21
+ path = Path(os.getcwd(), '.procure', '__init__.py')
22
+ if os.path.exists(path):
23
+ spec = importlib.util.spec_from_file_location(
24
+ "dot_procure", path
25
+ )
26
+ dot_procure = importlib.util.module_from_spec(spec)
27
+ spec.loader.exec_module(dot_procure)
28
+ else:
29
+ raise FileNotFoundError(f'{path} does not exist!')
30
+
31
+ solutions = dot_procure.solutions
32
+
33
+ for cls in solutions:
34
+ solution = cls()
35
+ print(f"Procuring: {cls.__name__}")
36
+ solution.update()
@@ -0,0 +1,5 @@
1
+ from .resource import Resource
2
+
3
+ class Project(Resource):
4
+ def update(self):
5
+ pass
@@ -0,0 +1,3 @@
1
+ class Resource:
2
+ def update(self):
3
+ pass
@@ -0,0 +1,34 @@
1
+ import subprocess
2
+ from pathlib import Path
3
+
4
+ from .project import Project
5
+
6
+
7
+ class Solution(Project):
8
+ def update(self):
9
+ pass
10
+
11
+
12
+ class GitSolution(Solution):
13
+ path = ""
14
+ url = ""
15
+ branch = ""
16
+
17
+ def update(self):
18
+ path = Path(self.path)
19
+ if not path.exists():
20
+ self.clone()
21
+ else:
22
+ self.pull()
23
+
24
+ def clone(self):
25
+ args = ["git", "clone"]
26
+ if self.branch:
27
+ args = args + ["-b", self.branch]
28
+ args = args + [self.url, self.path]
29
+ subprocess.run(args)
30
+
31
+ def pull(self):
32
+ path = Path(self.path)
33
+ args = ["git", f"--git-dir={path / '.git'}", f"--work-tree={path}", "pull"]
34
+ subprocess.run(args)
@@ -0,0 +1,74 @@
1
+
2
+ [build-system]
3
+ requires = ["hatchling"]
4
+ build-backend = "hatchling.build"
5
+
6
+ [project]
7
+ name = "procure"
8
+ version = "0.1.0"
9
+ description = 'Procure build assets'
10
+ readme = "README.md"
11
+ requires-python = ">=3.8"
12
+ license = { file = "LICENSE" }
13
+ keywords = []
14
+ authors = [{ name = "Kurtis Fields", email = "kurtisfields@gmail.com" }]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Programming Language :: Python",
18
+ "Programming Language :: Python :: 3.8",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: Implementation :: CPython",
23
+ "Programming Language :: Python :: Implementation :: PyPy",
24
+ ]
25
+ dependencies = [
26
+ "click ==8.1.3"
27
+ ]
28
+
29
+ #dynamic = ["version"]
30
+
31
+ [project.optional-dependencies]
32
+ dev = ["black ~=22.12.0"]
33
+ test = ["pytest ~=7.2.1"]
34
+
35
+ [project.scripts]
36
+ procure = 'procure.cli:cli'
37
+
38
+ [project.urls]
39
+ homepage = "https://github.com/crungelab/procure"
40
+ documentation = "https://crungelab.github.io/procure/"
41
+ repository = "https://github.com/crungelab/procure"
42
+ changelog = "https://github.com/crungelab/procure/blob/main/CHANGELOG.md"
43
+
44
+ [tool.hatch.version]
45
+ path = "procure/__about__.py"
46
+
47
+ [tool.hatch.envs.default]
48
+ dependencies = ["pytest", "pytest-cov"]
49
+
50
+ [tool.hatch.envs.default.scripts]
51
+ cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=deeper --cov=tests {args}"
52
+ no-cov = "cov --no-cov {args}"
53
+
54
+ [tool.hatch.envs.docs]
55
+ dependencies = [
56
+ "sphinx",
57
+ "furo",
58
+ "sphinxcontrib-apidoc",
59
+ "sphinxemoji"
60
+ ]
61
+
62
+ [tool.hatch.envs.docs.scripts]
63
+ build = "sphinx-build docs docs/_build"
64
+
65
+ [[tool.hatch.envs.test.matrix]]
66
+ python = ["38", "39", "310", "311"]
67
+
68
+ [tool.coverage.run]
69
+ branch = true
70
+ parallel = true
71
+ omit = ["procure/__about__.py"]
72
+
73
+ [tool.coverage.report]
74
+ exclude_lines = ["no cov", "if __name__ ~= .__main__.:", "if TYPE_CHECKING:"]