question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not include "typing" lib in `install_requires` if Python 3.5+

See original GitHub issue

From https://pypi.python.org/pypi/typing:

NOTE: in Python 3.5 and later, the typing module lives in the stdlib, and installing this package has NO EFFECT.

We should not force the install of typing for Python version 3.5 or later.

I’m suggesting the following change:

install_requires = ['six>=1.2']
if sys.version_info < (3, 5):
    install_requires.append('typing')

setup(
    [....]
    install_requires=install_requires,
    [....]
)

@trbs let me know what you think.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
hynekcommented, Mar 8, 2018

@luzfcb the most correct way is currently PEP 508 but the most compatible way appears to be the using extras_require. It strictly depends on how old pip/setuptools you want to support.

0reactions
trbscommented, Mar 11, 2018

If there other (edge) cases where it still fails please reopen the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specifying different versions of lz4 package in setup.py for ...
1 Answer 1 ... Dependencies can be declared in setup.py , not only in requirements.txt . In setup.py use install_requires : setup( …...
Read more >
26.1. typing — Support for type hints — Python 3.5.9 ...
A generic type can have any number of type variables, and type variables may be constrained: from typing import TypeVar, Generic ... T ......
Read more >
Python — Spack 0.20.0.dev0 documentation
PythonPackage uses pip to install the package, but pip requires a backend to actually build the package. To determine the build backend, look...
Read more >
How to create a Python library - Medium
Install_requires should be limited to the list of packages that are absolutely needed. This is because you do not want to make users...
Read more >
pip install setuptools==8.1 - PyPI
If you have Python 3.3 or later, you can use the py command to install to ... Additionally, later phases or invocations of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found