Reputation: 4080
My requirements.txt has got dataclasses
in it, to backport for python 3.6
However, some build machines and coworkers use python 3.7, which fails when it attempts to install this module.
Is there a way to make dataclasses only installed if it is necessary?
Upvotes: 4
Views: 875
Reputation: 4170
You can use Environmental Markers
dataclasses; python_version < '3.7'
Reference: https://www.python.org/dev/peps/pep-0345/#environment-markers
Upvotes: 6