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

build warnings: ambiguous configuration for packages selenium_driverless.files.* #154

Closed
milahu opened this issue Jan 25, 2024 · 3 comments

Comments

@milahu
Copy link

milahu commented Jan 25, 2024

these ugly warnings are fixed by using setuptools.find_namespace_packages in setup.py

-  setuptools.find_packages
+  setuptools.find_namespace_packages

https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

When you use find_packages(), all directories without an __init__.py file will be ignored. On the other hand, find_namespace_packages() will scan all directories.

the result is the same

$ find result/lib/python3.11/site-packages/selenium_driverless/files/ -type f
result/lib/python3.11/site-packages/selenium_driverless/files/__init__.py
result/lib/python3.11/site-packages/selenium_driverless/files/mv3_extension/manifest.json
result/lib/python3.11/site-packages/selenium_driverless/files/mv3_extension/driverless_background_mv3_243ffdd55e32a012b4f253b2879af978.js
result/lib/python3.11/site-packages/selenium_driverless/files/__pycache__/__init__.cpython-311.opt-1.pyc
result/lib/python3.11/site-packages/selenium_driverless/files/__pycache__/__init__.cpython-311.pyc
result/lib/python3.11/site-packages/selenium_driverless/files/js/show_mousemove.js

warnings from setuptools.find_packages

$ nix log /nix/store/q998wyl1p7jvqnknqm9a6h5ybih30vs3-python3.11-selenium-driverless-1.7.1 | grep "Python recognizes" 
        Python recognizes 'selenium_driverless.files.js' as an importable package[^1],
        Python recognizes 'selenium_driverless.files.mv3_extension' as an importable package[^1],
/nix/store/7fnhc3nd125lq9vzw6bghsvbnmcc8mc1-python3.11-setuptools-69.0.2/lib/python3.11/site-packages/setuptools/command/build_py.py:207: _Warning: Package 'selenium_driverless.files.js' is absent from the `packages` configuration.
!!

        ********************************************************************************
        ############################
        # Package would be ignored #
        ############################
        Python recognizes 'selenium_driverless.files.js' as an importable package[^1],
        but it is absent from setuptools' `packages` configuration.

        This leads to an ambiguous overall configuration. If you want to distribute this
        package, please make sure that 'selenium_driverless.files.js' is explicitly added
        to the `packages` configuration field.

        Alternatively, you can also rely on setuptools' discovery methods
        (for example by using `find_namespace_packages(...)`/`find_namespace:`
        instead of `find_packages(...)`/`find:`).

        You can read more about "package discovery" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

        If you don't want 'selenium_driverless.files.js' to be distributed and are
        already explicitly excluding 'selenium_driverless.files.js' via
        `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
        you can try to use `exclude_package_data`, or `include-package-data=False` in
        combination with a more fine grained `package-data` configuration.

        You can read more about "package data files" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


        [^1]: For Python, any directory (with suitable naming) can be imported,
              even if it does not contain any `.py` files.
              On the other hand, currently there is no concept of package data
              directory, all directories are treated like packages.
        ********************************************************************************
@kaliiiiiiiiii
Copy link
Owner

Uh yep - I'll test & then add it, thanks.
Maybe that's even gonna resolve #95 (comment)

@kaliiiiiiiiii
Copy link
Owner

kaliiiiiiiiii commented Jan 29, 2024

Note:

My logs here make me assume that all top-level files get included?

verbose setup.py log
> python setup.py sdist -v 
No `name` configuration, performing automatic discovery
running sdist
running egg_info
writing src\selenium_driverless.egg-info\PKG-INFO
writing dependency_links to src\selenium_driverless.egg-info\dependency_links.txt
writing requirements to src\selenium_driverless.egg-info\requires.txt
writing top-level names to src\selenium_driverless.egg-info\top_level.txt
reading manifest file 'src\selenium_driverless.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.md'
writing manifest file 'src\selenium_driverless.egg-info\SOURCES.txt'
running check
creating selenium_driverless-1.7.3
creating selenium_driverless-1.7.3\.github
creating selenium_driverless-1.7.3\.github\workflows
creating selenium_driverless-1.7.3\dev
creating selenium_driverless-1.7.3\dev\assets
creating selenium_driverless-1.7.3\docs
creating selenium_driverless-1.7.3\docs\.doctrees
creating selenium_driverless-1.7.3\docs\.doctrees\classes
creating selenium_driverless-1.7.3\docs\_modules
creating selenium_driverless-1.7.3\docs\_modules\selenium_driverless
creating selenium_driverless-1.7.3\docs\_modules\selenium_driverless\types
creating selenium_driverless-1.7.3\docs\_modules\selenium_driverless\types\options
creating selenium_driverless-1.7.3\docs\_modules\selenium_driverless\webdriver
creating selenium_driverless-1.7.3\docs\_sources
creating selenium_driverless-1.7.3\docs\_sources\classes
creating selenium_driverless-1.7.3\docs\_static
creating selenium_driverless-1.7.3\docs\_static\css
creating selenium_driverless-1.7.3\docs\_static\css\fonts
creating selenium_driverless-1.7.3\docs\_static\js
creating selenium_driverless-1.7.3\docs\classes
creating selenium_driverless-1.7.3\docs\classes\Chrome
creating selenium_driverless-1.7.3\docs\classes\ChromeOptions
creating selenium_driverless-1.7.3\docs\genindex
creating selenium_driverless-1.7.3\docs\search
creating selenium_driverless-1.7.3\docs_source
creating selenium_driverless-1.7.3\docs_source\classes
creating selenium_driverless-1.7.3\examples
creating selenium_driverless-1.7.3\src
creating selenium_driverless-1.7.3\src\selenium_driverless
creating selenium_driverless-1.7.3\src\selenium_driverless.egg-info
creating selenium_driverless-1.7.3\src\selenium_driverless\files
creating selenium_driverless-1.7.3\src\selenium_driverless\files\js
creating selenium_driverless-1.7.3\src\selenium_driverless\files\mv3_extension
creating selenium_driverless-1.7.3\src\selenium_driverless\input
creating selenium_driverless-1.7.3\src\selenium_driverless\scripts
creating selenium_driverless-1.7.3\src\selenium_driverless\sync
creating selenium_driverless-1.7.3\src\selenium_driverless\types
creating selenium_driverless-1.7.3\src\selenium_driverless\utils
creating selenium_driverless-1.7.3\tests
creating selenium_driverless-1.7.3\tests\selenium_detector
copying files to selenium_driverless-1.7.3...
copying LICENSE.md -> selenium_driverless-1.7.3
copying MANIFEST.in -> selenium_driverless-1.7.3
copying README.md -> selenium_driverless-1.7.3
copying build_upload.md -> selenium_driverless-1.7.3
copying main.py -> selenium_driverless-1.7.3
copying pyproject.toml -> selenium_driverless-1.7.3
copying requirements.txt -> selenium_driverless-1.7.3
copying setup.cfg -> selenium_driverless-1.7.3
copying setup.py -> selenium_driverless-1.7.3
copying sync_main.py -> selenium_driverless-1.7.3
copying .github\dependabot.yml -> selenium_driverless-1.7.3\.github
copying .github\workflows\dependency-review.yml -> selenium_driverless-1.7.3\.github\workflows
copying dev\README.md -> selenium_driverless-1.7.3\dev
copying dev\human_like_path.py -> selenium_driverless-1.7.3\dev
copying dev\new_elem_calc.py -> selenium_driverless-1.7.3\dev
copying dev\random_point_heatmap.py -> selenium_driverless-1.7.3\dev
copying dev\assets\bypass_turnstile.mp4 -> selenium_driverless-1.7.3\dev\assets
copying dev\assets\events_mouse.png -> selenium_driverless-1.7.3\dev\assets
copying dev\assets\events_mousepad.png -> selenium_driverless-1.7.3\dev\assets
copying dev\assets\heatmap.png -> selenium_driverless-1.7.3\dev\assets
copying dev\assets\mouse_path_gen.png -> selenium_driverless-1.7.3\dev\assets
copying dev\assets\mousemove_events_gen.png -> selenium_driverless-1.7.3\dev\assets
copying dev\assets\mousemove_events_test_sample_based.png -> selenium_driverless-1.7.3\dev\assets
copying dev\assets\mousemove_events_test_samples_based.png -> selenium_driverless-1.7.3\dev\assets
copying dev\assets\real_mouse_path.png -> selenium_driverless-1.7.3\dev\assets
copying docs\.buildinfo -> selenium_driverless-1.7.3\docs
copying docs\index.html -> selenium_driverless-1.7.3\docs
copying docs\objects.inv -> selenium_driverless-1.7.3\docs
copying docs\searchindex.js -> selenium_driverless-1.7.3\docs
copying docs\.doctrees\environment.pickle -> selenium_driverless-1.7.3\docs\.doctrees
copying docs\.doctrees\index.doctree -> selenium_driverless-1.7.3\docs\.doctrees
copying docs\.doctrees\classes\Chrome.doctree -> selenium_driverless-1.7.3\docs\.doctrees\classes
copying docs\.doctrees\classes\ChromeOptions.doctree -> selenium_driverless-1.7.3\docs\.doctrees\classes
copying docs\_modules\index.html -> selenium_driverless-1.7.3\docs\_modules
copying docs\_modules\selenium_driverless\types\options\index.html -> selenium_driverless-1.7.3\docs\_modules\selenium_driverless\types\options
copying docs\_modules\selenium_driverless\webdriver\index.html -> selenium_driverless-1.7.3\docs\_modules\selenium_driverless\webdriver
copying docs\_sources\index.rst.txt -> selenium_driverless-1.7.3\docs\_sources
copying docs\_sources\classes\Chrome.rst.txt -> selenium_driverless-1.7.3\docs\_sources\classes
copying docs\_sources\classes\ChromeOptions.rst.txt -> selenium_driverless-1.7.3\docs\_sources\classes
copying docs\_static\_sphinx_javascript_frameworks_compat.js -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\basic.css -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\doctools.js -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\documentation_options.js -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\file.png -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\jquery.js -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\language_data.js -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\minus.png -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\plus.png -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\pygments.css -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\searchtools.js -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\sphinx_highlight.js -> selenium_driverless-1.7.3\docs\_static
copying docs\_static\css\badge_only.css -> selenium_driverless-1.7.3\docs\_static\css
copying docs\_static\css\theme.css -> selenium_driverless-1.7.3\docs\_static\css
copying docs\_static\css\fonts\Roboto-Slab-Bold.woff -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\Roboto-Slab-Bold.woff2 -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\Roboto-Slab-Regular.woff -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\Roboto-Slab-Regular.woff2 -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\fontawesome-webfont.eot -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\fontawesome-webfont.svg -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\fontawesome-webfont.ttf -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\fontawesome-webfont.woff -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\fontawesome-webfont.woff2 -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\lato-bold-italic.woff -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\lato-bold-italic.woff2 -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\lato-bold.woff -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\lato-bold.woff2 -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\lato-normal-italic.woff -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\lato-normal-italic.woff2 -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\lato-normal.woff -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\css\fonts\lato-normal.woff2 -> selenium_driverless-1.7.3\docs\_static\css\fonts
copying docs\_static\js\badge_only.js -> selenium_driverless-1.7.3\docs\_static\js
copying docs\_static\js\html5shiv-printshiv.min.js -> selenium_driverless-1.7.3\docs\_static\js
copying docs\_static\js\html5shiv.min.js -> selenium_driverless-1.7.3\docs\_static\js
copying docs\_static\js\theme.js -> selenium_driverless-1.7.3\docs\_static\js
copying docs\classes\Chrome\index.html -> selenium_driverless-1.7.3\docs\classes\Chrome
copying docs\classes\ChromeOptions\index.html -> selenium_driverless-1.7.3\docs\classes\ChromeOptions
copying docs\genindex\index.html -> selenium_driverless-1.7.3\docs\genindex
copying docs\search\index.html -> selenium_driverless-1.7.3\docs\search
copying docs_source\conf.py -> selenium_driverless-1.7.3\docs_source
copying docs_source\index.rst -> selenium_driverless-1.7.3\docs_source
copying docs_source\classes\Chrome.rst -> selenium_driverless-1.7.3\docs_source\classes
copying docs_source\classes\ChromeOptions.rst -> selenium_driverless-1.7.3\docs_source\classes
copying examples\proxy_with_auth.py -> selenium_driverless-1.7.3\examples
copying src\selenium_driverless\__init__.py -> selenium_driverless-1.7.3\src\selenium_driverless
copying src\selenium_driverless\webdriver.py -> selenium_driverless-1.7.3\src\selenium_driverless
copying src\selenium_driverless.egg-info\PKG-INFO -> selenium_driverless-1.7.3\src\selenium_driverless.egg-info
copying src\selenium_driverless.egg-info\SOURCES.txt -> selenium_driverless-1.7.3\src\selenium_driverless.egg-info
copying src\selenium_driverless.egg-info\dependency_links.txt -> selenium_driverless-1.7.3\src\selenium_driverless.egg-info
copying src\selenium_driverless.egg-info\requires.txt -> selenium_driverless-1.7.3\src\selenium_driverless.egg-info
copying src\selenium_driverless.egg-info\top_level.txt -> selenium_driverless-1.7.3\src\selenium_driverless.egg-info
copying src\selenium_driverless\files\__init__.py -> selenium_driverless-1.7.3\src\selenium_driverless\files
copying src\selenium_driverless\files\js\show_mousemove.js -> selenium_driverless-1.7.3\src\selenium_driverless\files\js
copying src\selenium_driverless\files\mv3_extension\driverless_background_mv3_243ffdd55e32a012b4f253b2879af978.js -> selenium_driverless-1.7.3\src\selenium_driverless\files\mv3_extension
copying src\selenium_driverless\files\mv3_extension\manifest.json -> selenium_driverless-1.7.3\src\selenium_driverless\files\mv3_extension
copying src\selenium_driverless\input\__init__.py -> selenium_driverless-1.7.3\src\selenium_driverless\input
copying src\selenium_driverless\input\pointer.py -> selenium_driverless-1.7.3\src\selenium_driverless\input
copying src\selenium_driverless\scripts\__init__.py -> selenium_driverless-1.7.3\src\selenium_driverless\scripts
copying src\selenium_driverless\scripts\driver_utils.py -> selenium_driverless-1.7.3\src\selenium_driverless\scripts
copying src\selenium_driverless\scripts\geometry.py -> selenium_driverless-1.7.3\src\selenium_driverless\scripts
copying src\selenium_driverless\scripts\prefs.py -> selenium_driverless-1.7.3\src\selenium_driverless\scripts
copying src\selenium_driverless\scripts\switch_to.py -> selenium_driverless-1.7.3\src\selenium_driverless\scripts
copying src\selenium_driverless\sync\__init__.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\alert.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\base_target.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\context.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\executor.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\pointer.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\switch_to.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\target.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\webdriver.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\sync\webelement.py -> selenium_driverless-1.7.3\src\selenium_driverless\sync
copying src\selenium_driverless\types\__init__.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\types\alert.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\types\base_target.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\types\by.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\types\context.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\types\deserialize.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\types\options.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\types\target.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\types\webelement.py -> selenium_driverless-1.7.3\src\selenium_driverless\types
copying src\selenium_driverless\utils\__init__.py -> selenium_driverless-1.7.3\src\selenium_driverless\utils
copying src\selenium_driverless\utils\utils.py -> selenium_driverless-1.7.3\src\selenium_driverless\utils
copying tests\bypass_turnstile.py -> selenium_driverless-1.7.3\tests
copying tests\show_mousemove.py -> selenium_driverless-1.7.3\tests
copying tests\target_interception.py -> selenium_driverless-1.7.3\tests
copying tests\test_driverless.py -> selenium_driverless-1.7.3\tests
copying tests\turnstile_captcha.png -> selenium_driverless-1.7.3\tests
copying tests\selenium_detector\selenium_detector.py -> selenium_driverless-1.7.3\tests\selenium_detector
copying tests\selenium_detector\sync_selenium_detector.py -> selenium_driverless-1.7.3\tests\selenium_detector
copying src\selenium_driverless.egg-info\SOURCES.txt -> selenium_driverless-1.7.3\src\selenium_driverless.egg-info
Writing selenium_driverless-1.7.3\setup.cfg
Creating tar archive
removing 'selenium_driverless-1.7.3' (and everything under it)

=> to be fixed in some future, now idea how tho

@milahu
Copy link
Author

milahu commented Jan 29, 2024

python setup.py sdist -v

calling setup.py directly is deprecated

works for me with selenium-driverless.nix

this calls

pyproject-build --no-isolation --outdir dist/ --wheel
python3.11 -m installer --prefix /nix/store/4bddcmlx079qv73rb3ysw67yj888bj54-python3.11-selenium-driverless-1.7.1 selenium_driverless-1.7.1-py3-none-any.whl
$ find result/lib/python3.11/site-packages/selenium_driverless -type f | grep -v /__pycache__/ | cut -d/ -f5-
selenium_driverless/scripts/__init__.py
selenium_driverless/scripts/driver_utils.py
selenium_driverless/scripts/switch_to.py
selenium_driverless/scripts/geometry.py
selenium_driverless/scripts/prefs.py
selenium_driverless/__init__.py
selenium_driverless/files/__init__.py
selenium_driverless/files/mv3_extension/manifest.json
selenium_driverless/files/mv3_extension/driverless_background_mv3_243ffdd55e32a012b4f253b2879af978.js
selenium_driverless/files/js/show_mousemove.js
selenium_driverless/utils/__init__.py
selenium_driverless/utils/utils.py
selenium_driverless/webdriver.py
selenium_driverless/sync/__init__.py
selenium_driverless/sync/base_target.py
selenium_driverless/sync/context.py
selenium_driverless/sync/webdriver.py
selenium_driverless/sync/switch_to.py
selenium_driverless/sync/webelement.py
selenium_driverless/sync/target.py
selenium_driverless/sync/pointer.py
selenium_driverless/sync/alert.py
selenium_driverless/types/options.py
selenium_driverless/types/__init__.py
selenium_driverless/types/by.py
selenium_driverless/types/base_target.py
selenium_driverless/types/deserialize.py
selenium_driverless/types/context.py
selenium_driverless/types/webelement.py
selenium_driverless/types/target.py
selenium_driverless/types/alert.py
selenium_driverless/input/__init__.py
selenium_driverless/input/pointer.py

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

No branches or pull requests

2 participants