|
1 | | -#!/usr/bin/env python |
2 | | - |
3 | | -import codecs |
4 | | -import os |
5 | | -import re |
6 | | -import sys |
7 | | - |
8 | 1 | from setuptools import find_packages, setup |
9 | | -from setuptools.command.test import test as TestCommand |
10 | | - |
11 | | -long_description = open("README.rst").read() |
12 | | -here = os.path.abspath(os.path.dirname(__file__)) |
13 | | - |
14 | | - |
15 | | -def read(*parts): |
16 | | - # intentionally *not* adding an encoding option to open, See: |
17 | | - # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 |
18 | | - with codecs.open(os.path.join(here, *parts), "r") as fp: |
19 | | - return fp.read() |
20 | | - |
21 | | - |
22 | | -def find_version(*file_paths): |
23 | | - version_file = read(*file_paths) |
24 | | - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) |
25 | | - if version_match: |
26 | | - return version_match.group(1) |
27 | | - |
28 | | - raise RuntimeError("Unable to find version string.") |
29 | | - |
30 | | - |
31 | | -class PyTest(TestCommand): |
32 | | - def finalize_options(self): |
33 | | - TestCommand.finalize_options(self) |
34 | | - self.test_args = [] |
35 | | - self.test_suite = True |
36 | | - |
37 | | - def run_tests(self): |
38 | | - # import here, cause outside the eggs aren't loaded |
39 | | - import pytest |
40 | | - |
41 | | - errno = pytest.main(self.test_args) |
42 | | - sys.exit(errno) |
43 | | - |
44 | | - |
45 | | -install_requires = [ |
46 | | - "PyYAML", |
47 | | - "wrapt", |
48 | | - "yarl", |
49 | | - # Support for urllib3 >=2 needs Python >=3.10 |
50 | | - # so we need to block urllib3 >=2 for Python <3.10 for now. |
51 | | - # Note that vcrpy would work fine without any urllib3 around, |
52 | | - # so this block and the dependency can be dropped at some point |
53 | | - # in the future. For more Details: |
54 | | - # https://github.com/kevin1024/vcrpy/pull/699#issuecomment-1551439663 |
55 | | - "urllib3 <2; python_version <'3.10'", |
56 | | -] |
57 | 2 |
|
58 | | -tests_require = [ |
59 | | - "aiohttp", |
60 | | - "boto3", |
61 | | - "httplib2", |
62 | | - "httpx", |
63 | | - "pytest", |
64 | | - "pytest-aiohttp", |
65 | | - "pytest-httpbin", |
66 | | - "requests>=2.16.2", |
67 | | - "tornado", |
68 | | - # Needed to un-break httpbin 0.7.0. For httpbin >=0.7.1 and after, |
69 | | - # this pin and the dependency itself can be removed, provided |
70 | | - # that the related bug in httpbin has been fixed: |
71 | | - # https://github.com/kevin1024/vcrpy/issues/645#issuecomment-1562489489 |
72 | | - # https://github.com/postmanlabs/httpbin/issues/673 |
73 | | - # https://github.com/postmanlabs/httpbin/pull/674 |
74 | | - "Werkzeug==2.0.3", |
75 | | -] |
| 3 | +setup() |
76 | 4 |
|
77 | | -setup( |
78 | | - name="vcrpy", |
79 | | - version=find_version("vcr", "__init__.py"), |
80 | | - description=("Automatically mock your HTTP interactions to simplify and speed up testing"), |
81 | | - long_description=long_description, |
82 | | - long_description_content_type="text/x-rst", |
83 | | - author="Kevin McCarthy", |
84 | | - |
85 | | - url="https://github.com/kevin1024/vcrpy", |
86 | | - packages=find_packages(exclude=["tests*"]), |
87 | | - python_requires=">=3.8", |
88 | | - install_requires=install_requires, |
89 | | - license="MIT", |
90 | | - tests_require=tests_require, |
91 | | - classifiers=[ |
92 | | - "Development Status :: 5 - Production/Stable", |
93 | | - "Environment :: Console", |
94 | | - "Intended Audience :: Developers", |
95 | | - "Programming Language :: Python", |
96 | | - "Programming Language :: Python :: 3", |
97 | | - "Programming Language :: Python :: 3.8", |
98 | | - "Programming Language :: Python :: 3.9", |
99 | | - "Programming Language :: Python :: 3.10", |
100 | | - "Programming Language :: Python :: 3.11", |
101 | | - "Programming Language :: Python :: 3 :: Only", |
102 | | - "Programming Language :: Python :: Implementation :: CPython", |
103 | | - "Programming Language :: Python :: Implementation :: PyPy", |
104 | | - "Topic :: Software Development :: Testing", |
105 | | - "Topic :: Internet :: WWW/HTTP", |
106 | | - "License :: OSI Approved :: MIT License", |
107 | | - ], |
108 | | -) |
0 commit comments