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

pathspec should be an explicit dependency. #245

Closed
dwreeves opened this issue Oct 2, 2024 · 1 comment · Fixed by #246
Closed

pathspec should be an explicit dependency. #245

dwreeves opened this issue Oct 2, 2024 · 1 comment · Fixed by #246
Labels
bug Something isn't working fixed A fix has been submitted

Comments

@dwreeves
Copy link
Contributor

dwreeves commented Oct 2, 2024

TLDR

Pathspec should be an explicit dependency as it is used in plugin.py, but is not a dependency.

Long version

I have a job that pip installs the following requirements.txt and deploys my docs

mkdocs
pymdown-extensions
mkdocs-material
mkdocs-macros-plugin
pygments
markdown-include

I ran this and hit the following error:

Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/__main__.py", line 274, in gh_deploy_command
    cfg = config.load_config(remote_branch=remote_branch, remote_name=remote_name, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/config/base.py", line 363, in load_config
    errors, warnings = cfg.validate()
                       ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/config/base.py", line 228, in validate
    run_failed, run_warnings = self._validate()
                               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/config/base.py", line 186, in _validate
    self[key] = config_option.validate(value)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/config/config_options.py", line 1[47](https://github.com/dwreeves/dbt_linreg/actions/runs/11145478103/job/30975177463#step:5:48), in validate
    return self.run_validation(value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/config/config_options.py", line 939, in run_validation
    self.load_plugin_with_namespace(name, cfg)
  File "/usr/local/lib/python3.11/site-packages/mkdocs/config/config_options.py", line 975, in load_plugin_with_namespace
    return (name, self.load_plugin(name, config))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/config/config_options.py", line 993, in load_plugin
    plugin_cls = self.installed_plugins[name].load()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/metadata/__init__.py", line 198, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 11[49](https://github.com/dwreeves/dbt_linreg/actions/runs/11145478103/job/30975177463#step:5:50), in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.11/site-packages/mkdocs_macros/plugin.py", line 17, in <module>
    import pathspec

Full logs here: https://github.com/dwreeves/dbt_linreg/actions/runs/11145478103/job/30975177463

Pip install logs:

WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Requirement already satisfied: mkdocs in /usr/local/lib/python3.11/site-packages (from -r /github/workspace/docs/requirements.txt (line 1)) (1.4.2)
Requirement already satisfied: pymdown-extensions in /usr/local/lib/python3.11/site-packages (from -r /github/workspace/docs/requirements.txt (line 2)) (9.9.1)
Requirement already satisfied: mkdocs-material in /usr/local/lib/python3.11/site-packages (from -r /github/workspace/docs/requirements.txt (line 3)) (9.0.6)
Collecting mkdocs-macros-plugin
  Downloading mkdocs_macros_plugin-1.2.0-py3-none-any.whl (23 kB)
Requirement already satisfied: pygments in /usr/local/lib/python3.11/site-packages (from -r /github/workspace/docs/requirements.txt (line 5)) (2.14.0)
Collecting markdown-include
  Downloading markdown_include-0.[8](https://github.com/dwreeves/dbt_linreg/actions/runs/11145478103/job/30975177463#step:5:9).1-py3-none-any.whl (18 kB)
Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (8.1.3)
Requirement already satisfied: ghp-import>=1.0 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: jinja2>=2.11.1 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (3.1.2)
Requirement already satisfied: markdown<3.4,>=3.2.1 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (3.3.7)
Requirement already satisfied: mergedeep>=1.3.4 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (1.3.4)
Requirement already satisfied: packaging>=20.5 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (23.0)
Requirement already satisfied: pyyaml-env-tag>=0.1 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (0.1)
Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (6.0)
Requirement already satisfied: watchdog>=2.0 in /usr/local/lib/python3.11/site-packages (from mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (2.2.1)
Requirement already satisfied: colorama>=0.4 in /usr/local/lib/python3.11/site-packages (from mkdocs-material->-r /github/workspace/docs/requirements.txt (line 3)) (0.4.6)
Requirement already satisfied: mkdocs-material-extensions>=1.1 in /usr/local/lib/python3.11/site-packages (from mkdocs-material->-r /github/workspace/docs/requirements.txt (line 3)) (1.1.1)
Requirement already satisfied: regex>=2022.4.24 in /usr/local/lib/python3.11/site-packages (from mkdocs-material->-r /github/workspace/docs/requirements.txt (line 3)) (2022.[10](https://github.com/dwreeves/dbt_linreg/actions/runs/11145478103/job/30975177463#step:5:11).31)
Requirement already satisfied: requests>=2.26 in /usr/local/lib/python3.11/site-packages (from mkdocs-material->-r /github/workspace/docs/requirements.txt (line 3)) (2.28.2)
Collecting termcolor
  Downloading termcolor-2.4.0-py3-none-any.whl (7.7 kB)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.[11](https://github.com/dwreeves/dbt_linreg/actions/runs/11145478103/job/30975177463#step:5:12)/site-packages (from mkdocs-macros-plugin->-r /github/workspace/docs/requirements.txt (line 4)) (2.8.2)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/site-packages (from jinja2>=2.11.1->mkdocs->-r /github/workspace/docs/requirements.txt (line 1)) (2.1.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/site-packages (from python-dateutil->mkdocs-macros-plugin->-r /github/workspace/docs/requirements.txt (line 4)) (1.16.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests>=2.26->mkdocs-material->-r /github/workspace/docs/requirements.txt (line 3)) (3.0.1)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests>=2.26->mkdocs-material->-r /github/workspace/docs/requirements.txt (line 3)) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests>=2.26->mkdocs-material->-r /github/workspace/docs/requirements.txt (line 3)) (1.26.14)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests>=2.26->mkdocs-material->-r /github/workspace/docs/requirements.txt (line 3)) (2022.[12](https://github.com/dwreeves/dbt_linreg/actions/runs/11145478103/job/30975177463#step:5:13).7)
Installing collected packages: termcolor, markdown-include, mkdocs-macros-plugin
Successfully installed markdown-include-0.8.1 mkdocs-macros-plugin-1.2.0 termcolor-2.4.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

However, adding pathspec to my requirements.txt fixes the issue. Job with pathspec included: https://github.com/dwreeves/dbt_linreg/actions/runs/11145592808

@fralau
Copy link
Owner

fralau commented Oct 2, 2024

Thanks for the heads up!

@fralau fralau added the bug Something isn't working label Oct 2, 2024
@fralau fralau added the fixed A fix has been submitted label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed A fix has been submitted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants