Skip to content

Commit

Permalink
Move tests and docs directories outside of source directory
Browse files Browse the repository at this point in the history
These directories were previously included in the wheel package. Now,
they are not. This had resulted in the files being unnecessarily
downloaded and installed to virtual environments when using pip.
However, these files go unused production installations. These files are
only necessary for the development of importlib_metadata itself, so they
now live at the root of the project.

This was more noticeable when pip dependencies are vendored or bundled,
as it adds unnecessary bloat to these bundles.

The directories are still included in the sdist, so packagers and
library users can run the tests locally if they choose, they just wont
be installed to the site-packages directory.
  • Loading branch information
jdufresne committed Aug 15, 2020
1 parent 46efbf9 commit 30b1130
Show file tree
Hide file tree
Showing 16 changed files with 8 additions and 23 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 1 addition & 16 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,7 @@ install_requires =
pathlib2; python_version < '3'
contextlib2; python_version < '3'
configparser>=3.5; python_version < '3'
packages = find:

[options.package_data]
* = *.zip, *.file, *.txt, *.toml
importlib_metadata =
docs/*
docs/_static/*
importlib_metadata.tests.data =
*.egg
*.whl
packages = importlib_metadata

[mypy]
ignore_missing_imports = True
Expand All @@ -42,12 +33,6 @@ ignore_missing_imports = True
# that package.__spec__ is not None.
strict_optional = False

[mypy-importlib_metadata.docs.*]
ignore_errors: True

[mypy-importlib_metadata.tests.*]
ignore_errors: True

[wheel]
universal=1

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion importlib_metadata/tests/fixtures.py → tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import textwrap
import test.support

from .._compat import pathlib, contextlib
from importlib_metadata._compat import pathlib, contextlib


__metaclass__ = type
Expand Down
2 changes: 1 addition & 1 deletion importlib_metadata/tests/test_api.py → tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import unittest

from . import fixtures
from .. import (
from importlib_metadata import (
Distribution, PackageNotFoundError, distribution,
entry_points, files, metadata, requires, version,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import packaging.version

from . import fixtures
from .. import (
from importlib_metadata import (
Distribution,
_compat,
version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pyfakefs.fake_filesystem_unittest as ffs

from . import fixtures
from .. import (
from importlib_metadata import (
Distribution, EntryPoint, MetadataPathFinder,
PackageNotFoundError, distributions,
entry_points, metadata, version,
Expand Down
4 changes: 2 additions & 2 deletions importlib_metadata/tests/test_zip.py → tests/test_zip.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import unittest

from .. import (
from importlib_metadata import (
distribution, entry_points, files, PackageNotFoundError,
version, distributions,
)
Expand All @@ -20,7 +20,7 @@


class TestZip(unittest.TestCase):
root = 'importlib_metadata.tests.data'
root = 'tests.data'

def _fixture_on_path(self, filename):
pkg_file = resources.files(self.root).joinpath(filename)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extras =
[testenv:docs]
basepython = python3
commands =
sphinx-build importlib_metadata/docs build/sphinx/html
sphinx-build docs build/sphinx/html
extras =
docs

Expand Down

0 comments on commit 30b1130

Please sign in to comment.