Skip to content

Use environment markers in setup.py rather than explicitly switching requirements. #135

Closed
@tomchristie

Description

@tomchristie

Recommended by @uranusjr, here: #82 (comment)

I would strongly recommend using PEP 508 environment markers to specify dependencies instead. This allows for the same effect (in relatively recent Setuptools and pip), prevents the packager from needing to maintain platform-specific artifacts (e.g. wheels), and has immensely better compatibility with the new trend of locking-aware dependency management tools like Pipenv and Poetry.

The following should be functionality-wise equivalent to the if-elif-else clause:

requirements = [
    'click',
    'h11',
    'websockets>=6.0',
    "httptools; platform_system != 'Windows' and 'CYGWIN' not in platform_system and platform_python_implementation != 'PyPy'",
    "uvloop; platform_system != 'Windows' and 'CYGWIN' not in platform_system and platform_python_implementation != 'PyPy'",
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions