Skip to content

Commit 8b9f5a0

Browse files
P403n1x87sanchdagnufedemabdinur
authored
fix(setup): remove metadata redundancy [backport #8567 to 2.7] (#8639)
Backport of #8567 to 2.7 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 0ec3d72 commit 8b9f5a0

File tree

3 files changed

+11
-97
lines changed

3 files changed

+11
-97
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 & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -371,30 +371,6 @@ def __init__(
371371
self.optional = optional # If True, cmake errors are ignored
372372

373373

374-
long_description = """
375-
# dd-trace-py
376-
377-
`ddtrace` is Datadog's tracing library for Python. It is used to trace requests
378-
as they flow across web servers, databases and microservices so that developers
379-
have great visibility into bottlenecks and troublesome requests.
380-
381-
## Getting Started
382-
383-
For a basic product overview, installation and quick start, check out our
384-
[setup documentation][setup docs].
385-
386-
For more advanced usage and configuration, check out our [API
387-
documentation][api docs].
388-
389-
For descriptions of terminology used in APM, take a look at the [official
390-
documentation][visualization docs].
391-
392-
[setup docs]: https://docs.datadoghq.com/tracing/setup/python/
393-
[api docs]: https://ddtrace.readthedocs.io/
394-
[visualization docs]: https://docs.datadoghq.com/tracing/visualization/
395-
"""
396-
397-
398374
def get_exts_for(name):
399375
try:
400376
mod = load_module_from_project_file(
@@ -490,32 +466,8 @@ def get_exts_for(name):
490466
ext_modules = []
491467

492468

493-
bytecode = [
494-
"bytecode~=0.13.0; python_version=='3.7'",
495-
"bytecode; python_version>='3.8' and python_version<'3.11'",
496-
"bytecode>=0.14.0; python_version>='3.11'",
497-
"bytecode>=0.15.0; python_version>='3.12'",
498-
]
499-
500469
setup(
501470
name="ddtrace",
502-
description="Datadog APM client library",
503-
url="https://github.com/DataDog/dd-trace-py",
504-
package_urls={
505-
"Changelog": "https://ddtrace.readthedocs.io/en/stable/release_notes.html",
506-
"Documentation": "https://ddtrace.readthedocs.io/en/stable/",
507-
},
508-
project_urls={
509-
"Bug Tracker": "https://github.com/DataDog/dd-trace-py/issues",
510-
"Source Code": "https://github.com/DataDog/dd-trace-py/",
511-
"Changelog": "https://ddtrace.readthedocs.io/en/stable/release_notes.html",
512-
"Documentation": "https://ddtrace.readthedocs.io/en/stable/",
513-
},
514-
author="Datadog, Inc.",
515-
author_email="[email protected]",
516-
long_description=long_description,
517-
long_description_content_type="text/markdown",
518-
license="BSD",
519471
packages=find_packages(exclude=["tests*", "benchmarks*"]),
520472
package_data={
521473
"ddtrace": ["py.typed"],
@@ -524,60 +476,14 @@ def get_exts_for(name):
524476
"ddtrace.appsec._iast._taint_tracking": ["CMakeLists.txt"],
525477
"ddtrace.internal.datadog.profiling": ["libdd_wrapper.*"],
526478
},
527-
python_requires=">=3.7",
528479
zip_safe=False,
529480
# enum34 is an enum backport for earlier versions of python
530481
# funcsigs backport required for vendored debtcollector
531-
install_requires=[
532-
"ddsketch>=2.0.1",
533-
"protobuf>=3",
534-
"attrs>=20",
535-
"cattrs",
536-
"six>=1.12.0",
537-
"typing_extensions",
538-
"importlib_metadata<=6.5.0; python_version<'3.8'",
539-
"xmltodict>=0.12",
540-
"envier",
541-
"opentelemetry-api>=1",
542-
"setuptools; python_version>='3.12'",
543-
"sqlparse>=0.2.2",
544-
]
545-
+ bytecode,
546-
extras_require={
547-
# users can include opentracing by having:
548-
# install_requires=['ddtrace[opentracing]', ...]
549-
"opentracing": ["opentracing>=2.0.0"],
550-
},
551-
tests_require=["flake8"],
552482
cmdclass={
553483
"build_ext": CMakeBuild,
554484
"build_py": LibraryDownloader,
555485
"clean": CleanLibraries,
556486
},
557-
entry_points={
558-
"console_scripts": [
559-
"ddtrace-run = ddtrace.commands.ddtrace_run:main",
560-
],
561-
"pytest11": [
562-
"ddtrace = ddtrace.contrib.pytest.plugin",
563-
"ddtrace.pytest_bdd = ddtrace.contrib.pytest_bdd.plugin",
564-
],
565-
"opentelemetry_context": [
566-
"ddcontextvars_context = ddtrace.opentelemetry._context:DDRuntimeContext",
567-
],
568-
},
569-
classifiers=[
570-
"Development Status :: 5 - Production/Stable",
571-
"Programming Language :: Python :: Implementation :: CPython",
572-
"Programming Language :: Python",
573-
"Programming Language :: Python :: 3 :: Only",
574-
"Programming Language :: Python :: 3.7",
575-
"Programming Language :: Python :: 3.8",
576-
"Programming Language :: Python :: 3.9",
577-
"Programming Language :: Python :: 3.10",
578-
"Programming Language :: Python :: 3.11",
579-
"Programming Language :: Python :: 3.12",
580-
],
581487
setup_requires=["setuptools_scm[toml]>=4", "cython", "cmake>=3.24.2,<3.28"],
582488
ext_modules=ext_modules
583489
+ cythonize(

0 commit comments

Comments
 (0)