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

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

sputt
Copy link
Contributor

@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
Contributor 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

@markstory
Copy link
Member

Thanks for putting this together. The lint build is failing, but I'm not convinced the failure is related to your changes.

@markstory markstory merged commit 9f19f3f into getsentry:master Jan 9, 2025
15 of 16 checks passed
markstory added a commit that referenced this pull request Jan 9, 2025
markstory added a commit that referenced this pull request Jan 10, 2025
* Update changelog for #746
* Resolve mypy error.
* Move recorder docs
* Update changelog for #745
* mypy
* mypy + old python
@beliaev-maksim
Copy link
Collaborator

@markstory I recall there was an issue with discussion in the past. I think these tests are used in Debian package or something like for autotests

@sputt
Copy link
Contributor Author

sputt commented Jan 13, 2025

Ah good to check, but I would expect that is the source distribution which does still have tests.

@sputt sputt deleted the packaging-fix branch January 13, 2025 17:12
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.

3 participants