Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

setup.py fixes #79

Merged
merged 3 commits into from
Apr 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import codecs
try:
from setuptools import setup, find_packages
extra_setup = dict(
install_requires=['requests', 'Jinja2>=2.9'],
)
except ImportError:
from distutils.core import setup
extra_setup = {}

from setuptools import setup, find_packages

setup(
name='readthedocs-sphinx-ext',
Expand All @@ -16,13 +10,13 @@
url='http://github.com/readthedocs/readthedocs-sphinx-ext',
license='MIT',
description='Sphinx extension for Read the Docs overrides',
install_requires=['requests', 'Jinja2>=2.9'],
package_dir={'': '.'},
packages=find_packages('.'),
packages=find_packages('.', exclude=['tests']),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this, but I think some distributions run the tests after installing a package, so they expect them to be included

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Distributions usually run tests before building the package. According to my testing, setup.py sdist still includes them in the tarball. If you want them to be usable after installing the package, they need to be moved inside the package. Installing a global scope tests package is a very bad idea, and guaranteed to cause problems when done by more than one package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me, I also saw #60

long_description=codecs.open("README.rst", "r", "utf-8").read(),
# trying to add files...
include_package_data=True,
package_data={
'': ['_static/*.js', '_static/*.js_t', '_static/*.css', '_templates/*.tmpl'],
},
**extra_setup
)