-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
78 lines (64 loc) · 3.12 KB
/
Copy pathsetup.py
File metadata and controls
78 lines (64 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""Setup script for boilerplates package."""
import pathlib
import shutil
import tempfile
import git
import boilerplates.setup
def prepare_local_version_query():
"""Prepare local copy of version_query package to avoid circular dependency between packages."""
here = pathlib.Path(__file__).parent
module_path = here / 'boilerplates' / 'bundled_version_query'
if module_path.exists():
return
with tempfile.TemporaryDirectory() as temporary_path:
repo_path = pathlib.Path(temporary_path)
print(f'ensuring version-query repository is available locally at "{repo_path}"')
repo = git.Repo.clone_from('https://github.com/mbdevpl/version-query', repo_path)
repo.git.checkout('v1.6.3')
print(f'ensuring version_query module is available locally at "{module_path}"')
shutil.copytree(repo_path / 'version_query', module_path, dirs_exist_ok=True)
for filename in ('_version.py', '__main__.py', 'main.py'):
module_path.joinpath(filename).unlink()
prepare_local_version_query()
# pylint: disable = wrong-import-position
from boilerplates.bundled_version_query import predict_version_str # noqa: E402
VERSION = predict_version_str()
class Package(boilerplates.setup.Package):
"""Package metadata."""
name = 'boilerplates'
version = VERSION
description = 'Various boilerplates used in almost all of my Python packages.'
url = 'https://github.com/mbdevpl/python-boilerplates'
author = 'Mateusz Bysiek, Stian Hanssen'
maintainer = 'Mateusz Bysiek'
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: Version Control :: Git',
'Topic :: System :: Archiving :: Packaging',
'Topic :: System :: Installation/Setup',
'Topic :: System :: Logging',
'Topic :: System :: Software Distribution',
'Topic :: Utilities',
'Typing :: Typed']
keywords = ['git', 'logging', 'packaging', 'releasing']
extras_require = {
'setup': boilerplates.setup.parse_requirements('requirements_setup.txt'),
'packaging-tests': boilerplates.setup.parse_requirements(
'requirements_packaging_tests.txt'),
'config': boilerplates.setup.parse_requirements('requirements_config.txt'),
'logging': boilerplates.setup.parse_requirements('requirements_logging.txt'),
'sentry': boilerplates.setup.parse_requirements('requirements_sentry.txt'),
'cli': boilerplates.setup.parse_requirements('requirements_cli.txt'),
'git-repo-tests': boilerplates.setup.parse_requirements('requirements_git_repo_tests.txt')}
if __name__ == '__main__':
Package.setup()