Skip to content

Commit 9f72de7

Browse files
P403n1x87sanchdagnufedemabdinur
authored
fix(setup): remove metadata redundancy [backport #8567 to 2.6] (#8640)
Backport of #8567 to 2.6 We remove metadata redundancy in setup.py and move it as much as possible into pyproject.toml. This is crucial for dependencies, since their declaration in pyproject.toml overrides setup.py. Addresses #8566, #8604. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: David Sanchez <[email protected]> Co-authored-by: Federico Mon <[email protected]> Co-authored-by: Munir Abdinur <[email protected]>
1 parent 2278940 commit 9f72de7

File tree

3 files changed

+11
-96
lines changed

3 files changed

+11
-96
lines changed

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ authors = [
1313
{ name = "Datadog, Inc.", email = "[email protected]" },
1414
]
1515
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Programming Language :: Python :: Implementation :: CPython",
1618
"Programming Language :: Python",
19+
"Programming Language :: Python :: 3 :: Only",
1720
"Programming Language :: Python :: 3.7",
1821
"Programming Language :: Python :: 3.8",
1922
"Programming Language :: Python :: 3.9",
@@ -23,11 +26,12 @@ classifiers = [
2326
]
2427
dependencies = [
2528
"attrs>=20",
26-
"bytecode; python_version>='3.8'",
27-
"bytecode~=0.13.0; python_version=='3.7'",
29+
"bytecode>=0.15.0; python_version>='3.12'",
30+
"bytecode>=0.14.0; python_version~='3.11.0'",
31+
"bytecode>=0.13.0; python_version<'3.11'",
2832
"cattrs",
2933
"ddsketch>=2.0.1",
30-
"envier",
34+
"envier~=0.5",
3135
"importlib_metadata<=6.5.0; python_version<'3.8'",
3236
"opentelemetry-api>=1",
3337
"protobuf>=3",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
Fix for the declaration of dependencies for the package.

setup.py

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -403,30 +403,6 @@ def __init__(
403403
self.permissive_build = permissive_build # If True, build errors are ignored
404404

405405

406-
long_description = """
407-
# dd-trace-py
408-
409-
`ddtrace` is Datadog's tracing library for Python. It is used to trace requests
410-
as they flow across web servers, databases and microservices so that developers
411-
have great visibility into bottlenecks and troublesome requests.
412-
413-
## Getting Started
414-
415-
For a basic product overview, installation and quick start, check out our
416-
[setup documentation][setup docs].
417-
418-
For more advanced usage and configuration, check out our [API
419-
documentation][api docs].
420-
421-
For descriptions of terminology used in APM, take a look at the [official
422-
documentation][visualization docs].
423-
424-
[setup docs]: https://docs.datadoghq.com/tracing/setup/python/
425-
[api docs]: https://ddtrace.readthedocs.io/
426-
[visualization docs]: https://docs.datadoghq.com/tracing/visualization/
427-
"""
428-
429-
430406
def get_exts_for(name):
431407
try:
432408
mod = load_module_from_project_file(
@@ -538,92 +514,23 @@ def get_ddup_ext():
538514
return ddup_ext
539515

540516

541-
bytecode = [
542-
"bytecode~=0.13.0; python_version=='3.7'",
543-
"bytecode; python_version>='3.8' and python_version<'3.11'",
544-
"bytecode>=0.14.0; python_version>='3.11'",
545-
"bytecode>=0.15.0; python_version>='3.12'",
546-
]
547-
548517
setup(
549518
name="ddtrace",
550-
description="Datadog APM client library",
551-
url="https://github.com/DataDog/dd-trace-py",
552-
package_urls={
553-
"Changelog": "https://ddtrace.readthedocs.io/en/stable/release_notes.html",
554-
"Documentation": "https://ddtrace.readthedocs.io/en/stable/",
555-
},
556-
project_urls={
557-
"Bug Tracker": "https://github.com/DataDog/dd-trace-py/issues",
558-
"Source Code": "https://github.com/DataDog/dd-trace-py/",
559-
"Changelog": "https://ddtrace.readthedocs.io/en/stable/release_notes.html",
560-
"Documentation": "https://ddtrace.readthedocs.io/en/stable/",
561-
},
562-
author="Datadog, Inc.",
563-
author_email="[email protected]",
564-
long_description=long_description,
565-
long_description_content_type="text/markdown",
566-
license="BSD",
567519
packages=find_packages(exclude=["tests*", "benchmarks*"]),
568520
package_data={
569521
"ddtrace": ["py.typed"],
570522
"ddtrace.appsec": ["rules.json"],
571523
"ddtrace.appsec._ddwaf": [os.path.join("libddwaf", "*", "lib", "libddwaf.*")],
572524
"ddtrace.appsec._iast._taint_tracking": ["CMakeLists.txt"],
573525
},
574-
python_requires=">=3.7",
575526
zip_safe=False,
576527
# enum34 is an enum backport for earlier versions of python
577528
# funcsigs backport required for vendored debtcollector
578-
install_requires=[
579-
"ddsketch>=2.0.1",
580-
"protobuf>=3",
581-
"attrs>=20",
582-
"cattrs",
583-
"six>=1.12.0",
584-
"typing_extensions",
585-
"importlib_metadata<=6.5.0; python_version<'3.8'",
586-
"xmltodict>=0.12",
587-
"envier",
588-
"opentelemetry-api>=1",
589-
"setuptools; python_version>='3.12'",
590-
]
591-
+ bytecode,
592-
extras_require={
593-
# users can include opentracing by having:
594-
# install_requires=['ddtrace[opentracing]', ...]
595-
"opentracing": ["opentracing>=2.0.0"],
596-
},
597-
tests_require=["flake8"],
598529
cmdclass={
599530
"build_ext": CMakeBuild,
600531
"build_py": LibraryDownloader,
601532
"clean": CleanLibraries,
602533
},
603-
entry_points={
604-
"console_scripts": [
605-
"ddtrace-run = ddtrace.commands.ddtrace_run:main",
606-
],
607-
"pytest11": [
608-
"ddtrace = ddtrace.contrib.pytest.plugin",
609-
"ddtrace.pytest_bdd = ddtrace.contrib.pytest_bdd.plugin",
610-
],
611-
"opentelemetry_context": [
612-
"ddcontextvars_context = ddtrace.opentelemetry._context:DDRuntimeContext",
613-
],
614-
},
615-
classifiers=[
616-
"Development Status :: 5 - Production/Stable",
617-
"Programming Language :: Python :: Implementation :: CPython",
618-
"Programming Language :: Python",
619-
"Programming Language :: Python :: 3 :: Only",
620-
"Programming Language :: Python :: 3.7",
621-
"Programming Language :: Python :: 3.8",
622-
"Programming Language :: Python :: 3.9",
623-
"Programming Language :: Python :: 3.10",
624-
"Programming Language :: Python :: 3.11",
625-
"Programming Language :: Python :: 3.12",
626-
],
627534
setup_requires=["setuptools_scm[toml]>=4", "cython", "cmake>=3.24.2,<3.28"],
628535
ext_modules=ext_modules
629536
+ cythonize(

0 commit comments

Comments
 (0)