-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
111 lines (94 loc) · 3.2 KB
/
Copy pathsetup.py
File metadata and controls
111 lines (94 loc) · 3.2 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 - 2025 James E. King III (@jeking3) <jking@apache.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from pathlib import Path
from pkg_resources import parse_version
from setuptools import setup
# Configurables
name = "tempenv"
description = "Environment Variable Context Manager"
packages = ["tempenv"]
versionfile = "tempenv/version.py"
# Everything below should be cookie-cutter
def get_requirements(name: str) -> list:
"""
Return the contents of a requirements file
Arguments:
- name: the name of a file in the requirements directory
Returns:
- a list of requirements
"""
return read_file(Path(f"requirements/{name}.txt")).splitlines()
def read_file(path: Path) -> str:
"""
Return the contents of a file
Arguments:
- path: path to the file
Returns:
- contents of the file
"""
with path.open() as desc_file:
return desc_file.read().rstrip()
def version():
"""
Return the version string for the package stored in versionfile.
"""
_version = {}
exec(read_file(Path(versionfile)), _version)
return str(parse_version(_version["__version__"]))
requirements = {}
for type in ["dev", "run", "test"]:
requirements[type] = get_requirements(type)
setup(
name=name,
version=version(),
python_requires=">=3.9",
description=description,
long_description=read_file(Path("README.md")),
long_description_content_type="text/markdown",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Security",
"Topic :: System :: Shells",
"Topic :: Utilities",
"Typing :: Typed",
],
keywords="temporary, environment variable, context manager, test, testing",
download_url="https://github.com/jeking3/tempenv/archive/main.zip",
url="https://github.com/jeking3/tempenv",
author="James E. King III",
author_email="jking@apache.org",
license="Apache License 2.0",
install_requires=requirements["run"],
extras_require={
"dev": requirements["dev"],
"test": requirements["test"],
},
packages=packages,
include_package_data=True,
package_data={"tempenv": ["py.typed"]},
)