Skip to content

Commit

Permalink
Fix RTD doc compilation
Browse files Browse the repository at this point in the history
aio-libs#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
  • Loading branch information
multani committed Dec 31, 2021
1 parent 625f046 commit d6edb88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-r requirements-cython.txt
setuptools>=59.0.0 # Install a newer setuptools on rtd, which defaults to pre-https://github.com/pypa/setuptools/pull/2858
Sphinx==4.3.0
sphinxcontrib-asyncio==0.3.0
sphinxcontrib-spelling==7.2.1
Expand Down
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
from setuptools import Extension, setup
from setuptools.command.bdist_rpm import bdist_rpm as _bdist_rpm
from setuptools.command.build_ext import build_ext
from setuptools.errors import CCompilerError, ExecError, PlatformError

try:
from setuptools.errors import CCompilerError, ExecError, PlatformError
except ImportError:
# RTD workaround until it ships setuptools>=v59.0.0
# See:
# - https://github.com/pypa/setuptools/pull/2858
# - https://docs.readthedocs.io/en/stable/builds.html#python
from distutils.errors import CCompilerError, ExecError, PlatformError


# Those are needed to build _hton for windows
Expand Down

0 comments on commit d6edb88

Please sign in to comment.