jazzband / django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
MIT License
1.71k stars 448 forks source link

Exclude also tests submodules #633

Closed arkamar closed 1 year ago

arkamar commented 1 year ago

Description

It is necessary to extend exclude list with tests.* pattern, otherwise tests submodules will be installed as well. For reference, see custom discovery in setuptools documentation [1].

[1] https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#custom-discovery

Motivation and Context

Gentoo package manager refuses to install the package with following error:

* Messages for package dev-python/django-two-factor-auth-1.15.2:

 * The following unexpected files/directories were found top-level
 * in the site-packages directory:
 * 
 *   /usr/lib/python3.11/site-packages/tests
 * 
 * This is most likely a bug in the build system.  More information
 * can be found in the Python Guide:
 * https://projects.gentoo.org/python/guide/qawarn.html#stray-top-level-files-in-site-packages
 * ERROR: dev-python/django-two-factor-auth-1.15.2::localrepo failed (install phase):
 *   Failing install because of stray top-level files in site-packages

How Has This Been Tested?

The Gentoo package manager installs the package successfully, when the proposed change is included.

Types of changes

Checklist:

codecov[bot] commented 1 year ago

Codecov Report

Merging #633 (8811c63) into master (6150a78) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #633   +/-   ##
=======================================
  Coverage   95.46%   95.47%           
=======================================
  Files          74       75    +1     
  Lines        3198     3204    +6     
  Branches      358      359    +1     
=======================================
+ Hits         3053     3059    +6     
  Misses        116      116           
  Partials       29       29           
Impacted Files Coverage Δ
two_factor/plugins/phonenumber/apps.py 100.00% <100.00%> (ø)
two_factor/plugins/phonenumber/urls.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more