Mercurial > hgrepos > Python > libs > ConfigMix
annotate setup.py @ 428:090a25f36a3d
FIX: Allow jailed configurations to use correctly use base configurations that use a different "default" marker object.
Jailed configurations assumed that their "default" marker object is
identical to the "default" marker object in the unjailed base
configuration. This is not always true, especially if
"_JailedConfiguration.rebind()" is used.
Removed the explicit "default" keyword argument and passed the complete
keywords argument dictionary to the base instead. This triggers correct
default handling in the base.
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Thu, 09 Dec 2021 13:02:17 +0100 |
| parents | eed16a1ec8f3 |
| children | f71d34dda19f |
| rev | line source |
|---|---|
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
3 |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
4 import re |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
5 import os |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
6 import sys |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
7 try: |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
8 from setuptools import setup |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
9 except ImportError: |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
10 from distutils.core import setup |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
11 |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
12 |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
13 if (sys.version_info[0] < 2) or \ |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
14 ((sys.version_info[0] == 2) and (sys.version_info[1] < 6)): |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
15 raise ValueError("Need at least Python 2.6") |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
16 |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
17 |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
18 pkg_root = os.path.dirname(__file__) |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
19 |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
20 _version_re = re.compile(br"^\s*__version__\s*=\s*(\"|')(.*)\1\s*(#.*)?$", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
21 re.MULTILINE) |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
22 |
|
5
dc058099a4cb
Renamed the project from "MixConfig" to "ConfigMix"
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
23 with open(os.path.join(pkg_root, "configmix", "__init__.py"), "rb") as vf: |
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
24 version = _version_re.search(vf.read()).group(2).decode("utf-8") |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
25 |
|
71
80dcb41928a7
Rename README to README.txt to be more consistent with LICENSE.txt
Franz Glasner <hg@dom66.de>
parents:
70
diff
changeset
|
26 with open(os.path.join(pkg_root, "README.txt"), "rt") as rf: |
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
27 long_description = rf.read() |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
28 |
|
282
da1596034954
Implemented an "AWS" namespace to retrieve some AWS-specific metadata
Franz Glasner <fzglas.hg@dom66.de>
parents:
277
diff
changeset
|
29 aws_requirements = [ |
|
da1596034954
Implemented an "AWS" namespace to retrieve some AWS-specific metadata
Franz Glasner <fzglas.hg@dom66.de>
parents:
277
diff
changeset
|
30 "requests", |
|
da1596034954
Implemented an "AWS" namespace to retrieve some AWS-specific metadata
Franz Glasner <fzglas.hg@dom66.de>
parents:
277
diff
changeset
|
31 ] |
|
da1596034954
Implemented an "AWS" namespace to retrieve some AWS-specific metadata
Franz Glasner <fzglas.hg@dom66.de>
parents:
277
diff
changeset
|
32 |
|
184
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
33 yaml_requirements = [ |
|
235
a8b2346e2330
Tested up to PyYAML 5.3.1: so (with semantic versioning): adjust requirements to "<6"
Franz Glasner <fzglas.hg@dom66.de>
parents:
199
diff
changeset
|
34 "PyYAML>=3.0,<6", |
|
184
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
35 ] |
|
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
36 |
|
195
28e6c1413947
Added support for TOML style configuration files
Franz Glasner <fzglas.hg@dom66.de>
parents:
185
diff
changeset
|
37 toml_requirements = [ |
|
28e6c1413947
Added support for TOML style configuration files
Franz Glasner <fzglas.hg@dom66.de>
parents:
185
diff
changeset
|
38 "toml>=0.10", |
|
28e6c1413947
Added support for TOML style configuration files
Franz Glasner <fzglas.hg@dom66.de>
parents:
185
diff
changeset
|
39 ] |
|
28e6c1413947
Added support for TOML style configuration files
Franz Glasner <fzglas.hg@dom66.de>
parents:
185
diff
changeset
|
40 |
|
184
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
41 all_requirements = [] |
|
282
da1596034954
Implemented an "AWS" namespace to retrieve some AWS-specific metadata
Franz Glasner <fzglas.hg@dom66.de>
parents:
277
diff
changeset
|
42 all_requirements.extend(aws_requirements) |
|
184
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
43 all_requirements.extend(yaml_requirements) |
|
195
28e6c1413947
Added support for TOML style configuration files
Franz Glasner <fzglas.hg@dom66.de>
parents:
185
diff
changeset
|
44 all_requirements.extend(toml_requirements) |
|
184
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
45 |
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
46 setup( |
|
5
dc058099a4cb
Renamed the project from "MixConfig" to "ConfigMix"
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
47 name="ConfigMix", |
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
48 version=version, |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
49 author="Franz Glasner", |
|
296
eed16a1ec8f3
Use SPDX license identifiers (either full or short) all over the package
Franz Glasner <fzglas.hg@dom66.de>
parents:
282
diff
changeset
|
50 license='BSD 3-Clause "New" or "Revised" License', |
|
5
dc058099a4cb
Renamed the project from "MixConfig" to "ConfigMix"
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
51 url="https://pypi.dom66.de/simple/configmix/", |
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
52 description="Library for extended configuration files", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
53 long_description=long_description, |
|
282
da1596034954
Implemented an "AWS" namespace to retrieve some AWS-specific metadata
Franz Glasner <fzglas.hg@dom66.de>
parents:
277
diff
changeset
|
54 packages=["configmix", |
|
da1596034954
Implemented an "AWS" namespace to retrieve some AWS-specific metadata
Franz Glasner <fzglas.hg@dom66.de>
parents:
277
diff
changeset
|
55 "configmix.extras"], |
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
56 include_package_data=False, |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
57 zip_safe=True, |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
58 platforms="any", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
59 classifiers=[ |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
60 "Development Status :: 5 - Production/Stable", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
61 "Environment :: Console", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
62 "Intended Audience :: Developers", |
|
4
f76d85ccc5b9
Switch to the "New BSD License"
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
0
diff
changeset
|
63 "License :: OSI Approved :: BSD License", |
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
64 "Operating System :: OS Independent", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
65 "Programming Language :: Python", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
66 "Programming Language :: Python :: 2.6", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
67 "Programming Language :: Python :: 2.7", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
68 "Programming Language :: Python :: 3", |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
69 "Topic :: Software Development :: Libraries :: Python Modules" |
|
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
70 ], |
|
185
5c27e52c3483
Declare requirements on the Python version formally also
Franz Glasner <fzglas.hg@dom66.de>
parents:
184
diff
changeset
|
71 python_requires=">=2.6", |
|
184
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
72 extras_require={ |
|
282
da1596034954
Implemented an "AWS" namespace to retrieve some AWS-specific metadata
Franz Glasner <fzglas.hg@dom66.de>
parents:
277
diff
changeset
|
73 "aws" : aws_requirements, |
|
195
28e6c1413947
Added support for TOML style configuration files
Franz Glasner <fzglas.hg@dom66.de>
parents:
185
diff
changeset
|
74 "toml": toml_requirements, |
|
184
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
75 "yaml": yaml_requirements, |
|
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
76 "all" : all_requirements, |
|
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
77 }, |
|
781b8dc1883f
Use the pip "extras" feature to install optional features (e.g. PyYAML)
Franz Glasner <fzglas.hg@dom66.de>
parents:
80
diff
changeset
|
78 tests_require=all_requirements, |
|
0
53ea2bc254e7
Begin a package to abstract some of the important configuration handling stuff.
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
79 ) |
