mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 01:26:51 +03:00
a5166bf591
* Add Python 3.12 Support (#752) * Ignore .vscode * Python 3.12 Support * Change base python to 3.12 and pin pydantic to V1 * all tests passed * ci: change default python to 3.12 * remove legacy python versions * annotate pydantic models for tests * Update publishing pipeline to use Python 3.12 * Test environment updates * Update Cython to the latest prior 3.0 version and remove tracing from CI/CD * Give up using editable tox installation in the coverage job * Add mypy test fixes * Remove tracing from the coverage job * Fix typing test * Remove PyPy 2.7 * Fix typing test * Fix the typing issue with pydantic * Remove pypy 3.9 * Fix the typing issue with mypy * Update pydantic version to the latest from 1.x * Update scipy deprecation warning filter * Fix the tox job running coveralls * Update changelog --------- Co-authored-by: Anton Petrov <anton.a.petrov@gmail.com>
128 lines
4.1 KiB
Python
128 lines
4.1 KiB
Python
"""`Dependency injector` setup script."""
|
|
|
|
import os
|
|
import re
|
|
import sys
|
|
|
|
from setuptools import setup, Extension
|
|
|
|
|
|
def _open(filename):
|
|
if sys.version_info[0] == 2:
|
|
return open(filename)
|
|
return open(filename, encoding="utf-8")
|
|
|
|
|
|
# Defining setup variables:
|
|
defined_macros = dict()
|
|
defined_macros["CYTHON_CLINE_IN_TRACEBACK"] = 0
|
|
|
|
# Getting description:
|
|
with _open("README.rst") as readme_file:
|
|
description = readme_file.read()
|
|
|
|
# Getting requirements:
|
|
with _open("requirements.txt") as requirements_file:
|
|
requirements = requirements_file.readlines()
|
|
|
|
# Getting version:
|
|
with _open("src/dependency_injector/__init__.py") as init_file:
|
|
version = re.search("__version__ = \"(.*?)\"", init_file.read()).group(1)
|
|
|
|
# Adding debug options:
|
|
if os.environ.get("DEPENDENCY_INJECTOR_DEBUG_MODE") == "1":
|
|
defined_macros["CYTHON_TRACE"] = 1
|
|
defined_macros["CYTHON_TRACE_NOGIL"] = 1
|
|
defined_macros["CYTHON_CLINE_IN_TRACEBACK"] = 1
|
|
|
|
|
|
setup(name="dependency-injector",
|
|
version=version,
|
|
description="Dependency injection framework for Python",
|
|
long_description=description,
|
|
author="Roman Mogylatov",
|
|
author_email="rmogilatov@gmail.com",
|
|
maintainer="Roman Mogylatov",
|
|
maintainer_email="rmogilatov@gmail.com",
|
|
url="https://github.com/ets-labs/python-dependency-injector",
|
|
download_url="https://pypi.python.org/pypi/dependency_injector",
|
|
packages=[
|
|
"dependency_injector",
|
|
"dependency_injector.ext",
|
|
],
|
|
package_dir={
|
|
"": "src",
|
|
},
|
|
package_data={
|
|
"dependency_injector": ["*.pxd", "*.pyi", "py.typed"],
|
|
},
|
|
ext_modules=[
|
|
Extension("dependency_injector.containers",
|
|
["src/dependency_injector/containers.c"],
|
|
define_macros=list(defined_macros.items()),
|
|
extra_compile_args=["-O2"]),
|
|
Extension("dependency_injector.providers",
|
|
["src/dependency_injector/providers.c"],
|
|
define_macros=list(defined_macros.items()),
|
|
extra_compile_args=["-O2"]),
|
|
Extension("dependency_injector._cwiring",
|
|
["src/dependency_injector/_cwiring.c"],
|
|
define_macros=list(defined_macros.items()),
|
|
extra_compile_args=["-O2"]),
|
|
],
|
|
install_requires=requirements,
|
|
extras_require={
|
|
"yaml": [
|
|
"pyyaml",
|
|
],
|
|
"pydantic": [
|
|
"pydantic",
|
|
],
|
|
"flask": [
|
|
"flask",
|
|
],
|
|
"aiohttp": [
|
|
"aiohttp",
|
|
],
|
|
},
|
|
zip_safe=True,
|
|
license="BSD New",
|
|
platforms=["any"],
|
|
keywords=[
|
|
"Dependency injection",
|
|
"DI",
|
|
"Inversion of Control",
|
|
"IoC",
|
|
"Factory",
|
|
"Singleton",
|
|
"Design patterns",
|
|
"Flask",
|
|
],
|
|
classifiers=[
|
|
"Development Status :: 5 - Production/Stable",
|
|
"Intended Audience :: Developers",
|
|
"License :: OSI Approved :: BSD License",
|
|
"Operating System :: OS Independent",
|
|
"Programming Language :: Python",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.7",
|
|
"Programming Language :: Python :: 3.8",
|
|
"Programming Language :: Python :: 3.9",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
"Framework :: AsyncIO",
|
|
"Framework :: Bottle",
|
|
"Framework :: Django",
|
|
"Framework :: Flask",
|
|
"Framework :: Pylons",
|
|
"Framework :: Pyramid",
|
|
"Framework :: Pytest",
|
|
"Framework :: TurboGears",
|
|
"Topic :: Software Development",
|
|
"Topic :: Software Development :: Libraries",
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
])
|