|
1 | 1 | """Packaging logic for betamax."""
|
2 |
| -import os |
3 |
| -import re |
4 |
| -import sys |
5 |
| - |
6 | 2 | import setuptools
|
7 | 3 |
|
8 |
| -packages = setuptools.find_packages( |
9 |
| - "src", |
10 |
| - exclude=["tests", "tests.integration"], |
11 |
| -) |
12 |
| -requires = ["requests >= 2.0"] |
13 |
| - |
14 |
| -__version__ = "" |
15 |
| -with open("src/betamax/__init__.py", "r") as fd: |
16 |
| - reg = re.compile(r"__version__ = [\'']([^\'']*)[\'']") |
17 |
| - for line in fd: |
18 |
| - m = reg.match(line) |
19 |
| - if m: |
20 |
| - __version__ = m.group(1) |
21 |
| - break |
22 |
| - |
23 |
| -if not __version__: |
24 |
| - raise RuntimeError("Cannot find version information") |
25 |
| - |
26 |
| -if sys.argv[-1] in ["submit", "publish"]: |
27 |
| - os.system("python setup.py sdist bdist_wheel upload") |
28 |
| - sys.exit() |
29 |
| - |
30 |
| - |
31 |
| -def data_for(filename): |
32 |
| - """Read the file data for a filename.""" |
33 |
| - with open(filename) as fd: |
34 |
| - content = fd.read() |
35 |
| - return content |
36 |
| - |
37 |
| - |
38 |
| -setuptools.setup( |
39 |
| - name="betamax", |
40 |
| - version=__version__, |
41 |
| - description="A VCR imitation for python-requests", |
42 |
| - long_description="\n\n".join([data_for("README.rst"), |
43 |
| - data_for("HISTORY.rst")]), |
44 |
| - license="Apache 2.0", |
45 |
| - author="Ian Stapleton Cordasco", |
46 |
| - |
47 |
| - url="https://github.com/sigmavirus24/betamax", |
48 |
| - packages=packages, |
49 |
| - package_dir={"": "src"}, |
50 |
| - package_data={"": ["LICENSE", "AUTHORS.rst"]}, |
51 |
| - include_package_data=True, |
52 |
| - install_requires=requires, |
53 |
| - entry_points={ |
54 |
| - "pytest11": ["pytest-betamax = betamax.fixtures.pytest"] |
55 |
| - }, |
56 |
| - python_requires='>=3.8', |
57 |
| - classifiers=[ |
58 |
| - "Development Status :: 5 - Production/Stable", |
59 |
| - "License :: OSI Approved", |
60 |
| - "Intended Audience :: Developers", |
61 |
| - "Programming Language :: Python", |
62 |
| - "Programming Language :: Python :: 3 :: Only", |
63 |
| - "Programming Language :: Python :: 3.8", |
64 |
| - "Programming Language :: Python :: 3.9", |
65 |
| - "Programming Language :: Python :: 3.10", |
66 |
| - "Programming Language :: Python :: 3.11", |
67 |
| - "Programming Language :: Python :: Implementation :: CPython", |
68 |
| - ] |
69 |
| -) |
| 4 | +setuptools.setup() |
0 commit comments