Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tests from the wheel and simplify setup.py. #746

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sputt
Copy link

@sputt sputt commented Dec 27, 2024

Remove the tests/ directory from the wheel distribution of responses. Wheels are intended to be a production release containing no tests.

Update setup.py removing include_package_data arg, which causes the wheel to contain the tests. Add a pyproject.toml with setup requires and a build backend. Remove references to the deprecated test command of setup tools.

@sputt
Copy link
Author

sputt commented Dec 27, 2024

Wheel before

(venv) sputt@sputt-mbp2 responses % unzip -l dist/responses-0.25.3-py3-none-any.whl 
Archive:  dist/responses-0.25.3-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
    43724  12-27-2024 03:10   responses/__init__.py
     5339  12-27-2024 03:10   responses/_recorder.py
    13654  12-27-2024 03:10   responses/matchers.py
      158  12-27-2024 03:10   responses/py.typed
     4141  12-27-2024 03:10   responses/registries.py
        0  12-27-2024 03:10   responses/tests/__init__.py
    32904  12-27-2024 03:10   responses/tests/test_matchers.py
      977  12-27-2024 03:10   responses/tests/test_multithreading.py
     6897  12-27-2024 03:10   responses/tests/test_recorder.py
     5811  12-27-2024 03:10   responses/tests/test_registries.py
    84936  12-27-2024 03:10   responses/tests/test_responses.py
    10835  12-27-2024 03:25   responses-0.25.3.dist-info/LICENSE
    46718  12-27-2024 03:25   responses-0.25.3.dist-info/METADATA
       91  12-27-2024 03:25   responses-0.25.3.dist-info/WHEEL
       10  12-27-2024 03:25   responses-0.25.3.dist-info/top_level.txt
     1330  12-27-2024 03:25   responses-0.25.3.dist-info/RECORD
---------                     -------
   257525                     16 files

Wheel after

(venv) sputt@sputt-mbp2 responses % unzip -l dist/responses-0.25.4-py3-none-any.whl 
Archive:  dist/responses-0.25.4-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
    43724  12-27-2024 03:10   responses/__init__.py
     5339  12-27-2024 03:10   responses/_recorder.py
    13654  12-27-2024 03:10   responses/matchers.py
      158  12-27-2024 03:10   responses/py.typed
     4141  12-27-2024 03:10   responses/registries.py
    10835  12-27-2024 04:14   responses-0.25.4.dist-info/LICENSE
    46718  12-27-2024 04:14   responses-0.25.4.dist-info/METADATA
       91  12-27-2024 04:14   responses-0.25.4.dist-info/WHEEL
       10  12-27-2024 04:14   responses-0.25.4.dist-info/top_level.txt
      794  12-27-2024 04:14   responses-0.25.4.dist-info/RECORD
---------                     -------
   125464                     10 files

Note that the source dist still contains:

(venv) sputt@sputt-mbp2 responses % tar tf dist/responses-0.25.4.tar.gz                           
responses-0.25.4/
responses-0.25.4/CHANGES
responses-0.25.4/LICENSE
responses-0.25.4/MANIFEST.in
responses-0.25.4/PKG-INFO
responses-0.25.4/README.rst
responses-0.25.4/pyproject.toml
responses-0.25.4/responses/
responses-0.25.4/responses/__init__.py
responses-0.25.4/responses/_recorder.py
responses-0.25.4/responses/matchers.py
responses-0.25.4/responses/py.typed
responses-0.25.4/responses/registries.py
responses-0.25.4/responses/tests/
responses-0.25.4/responses/tests/__init__.py
responses-0.25.4/responses/tests/test_matchers.py
responses-0.25.4/responses/tests/test_multithreading.py
responses-0.25.4/responses/tests/test_recorder.py
responses-0.25.4/responses/tests/test_registries.py
responses-0.25.4/responses/tests/test_responses.py
responses-0.25.4/responses.egg-info/
responses-0.25.4/responses.egg-info/PKG-INFO
responses-0.25.4/responses.egg-info/SOURCES.txt
responses-0.25.4/responses.egg-info/dependency_links.txt
responses-0.25.4/responses.egg-info/not-zip-safe
responses-0.25.4/responses.egg-info/requires.txt
responses-0.25.4/responses.egg-info/top_level.txt
responses-0.25.4/setup.cfg
responses-0.25.4/setup.py
responses-0.25.4/tox.ini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant