-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add support for pre-install step #6662
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
Comments
If RTD had a hook that allowed overriding the entire install/build process, setuptools has a |
Hi @jaraco! Thanks for reporting this. We have a long discussion internally about features like this and we haven't made a decision yet. We are discussing topics like "allowing user to run just random commands" and "allow to upload a pre-built HTML" which are related in some way to what you are needing at this point. I don't have a good answer and we don't know when we are going to implement these. We need to keep discussing and make a final decision. Although, your report will help us to have another use case where we need to make a decision and do something about this. |
…ered processing package index. Andrew Taylor (1): Add info message when authentication error encountered processing package index. Bastian Venthur (5): Deprecated Eggsecutable Scripts Put deprecation in section rather then removing it (updated changelog as well) Added test for DeprecationWarning warning -> deprecated Removed unused context.quiet Dan Rose (1): Remove sys.modules hack Jason R. Coombs (29): Error on warnings. Fixes #1823. Move the error directive to the top, as it's more permanent. Add changelog entry normalize indentation Remove the Features feature. Fixes #65. Update changelog. Add azure pipelines from jaraco/skeleton Bootstrap the environment in tox, allowing simple 'tox' to run tests and simplifying all of the pipelines. Update deprecation version and include extension on changelog file. Avoid installing setuptools 45 on Python 2. Pin virtualenv to <20 as workaround for #1998. Suppress failures due to unfortunate combination of issues. Ref #2000. Copy docs requirements to a separate file due to RTD constraints. Fixes #2001. Ref readthedocs/readthedocs.org#6662 Bump version: 45.2.0 → 45.3.0 Also remove mysterious hack from pkg_resources.extern Try building docs with python3. Ref #1992. Reword UserWarning for insecure extraction path so that the message can be keyed for ignoring it. Ref #1899. Suppress UserWarning in pkg_resources. Try installing pip Use pep517 to avoid bb://pypa/distlib#136. Emit the Python version Add a file 'runtime.txt' to let Netlify know to use that env. Fixes #1992. Docs land in build/html Add a note about runtime.txt Suppress RuntimeWarning from sandbox module on Python 2 Suppress Windows bytes API warning until it can be fixed. Ref #2016. Suppress another warning Get both UnicodeWarnings Bump version: 45.3.0 → 46.0.0 Miro Hrončok (1): Include pkg_resources test data in sdist Ye-hyoung Kang (2): Fix broken link to Python docs Create 2011.doc.rst mayeut (1): Use CPython 3.8.0 mechanism to find msvc 14+
…ered processing package index. Andrew Taylor (1): Add info message when authentication error encountered processing package index. Bastian Venthur (5): Deprecated Eggsecutable Scripts Put deprecation in section rather then removing it (updated changelog as well) Added test for DeprecationWarning warning -> deprecated Removed unused context.quiet Dan Rose (1): Remove sys.modules hack Jason R. Coombs (29): Error on warnings. Fixes #1823. Move the error directive to the top, as it's more permanent. Add changelog entry normalize indentation Remove the Features feature. Fixes #65. Update changelog. Add azure pipelines from jaraco/skeleton Bootstrap the environment in tox, allowing simple 'tox' to run tests and simplifying all of the pipelines. Update deprecation version and include extension on changelog file. Avoid installing setuptools 45 on Python 2. Pin virtualenv to <20 as workaround for #1998. Suppress failures due to unfortunate combination of issues. Ref #2000. Copy docs requirements to a separate file due to RTD constraints. Fixes #2001. Ref readthedocs/readthedocs.org#6662 Bump version: 45.2.0 → 45.3.0 Also remove mysterious hack from pkg_resources.extern Try building docs with python3. Ref #1992. Reword UserWarning for insecure extraction path so that the message can be keyed for ignoring it. Ref #1899. Suppress UserWarning in pkg_resources. Try installing pip Use pep517 to avoid bb://pypa/distlib#136. Emit the Python version Add a file 'runtime.txt' to let Netlify know to use that env. Fixes #1992. Docs land in build/html Add a note about runtime.txt Suppress RuntimeWarning from sandbox module on Python 2 Suppress Windows bytes API warning until it can be fixed. Ref #2016. Suppress another warning Get both UnicodeWarnings Bump version: 45.3.0 → 46.0.0 Miro Hrončok (1): Include pkg_resources test data in sdist Ye-hyoung Kang (2): Fix broken link to Python docs Create 2011.doc.rst mayeut (1): Use CPython 3.8.0 mechanism to find msvc 14+
FWIW, I've hacked around this for my Pydoc-Markdown project (link to rtd). I created readthedocs-custom-steps which hooks into the MkDocs invocation on Read the Docs and instead routes it to a Python module that reads the contents of Unfortunately version: 2
mkdocs: {}
python:
version: 3.7
install:
- {method: pip, path: .}
- requires: readthedocs-custom-steps
x-custom-steps:
- echo "This is a custom build step. Output folder is $SITE_DIR"
- ... |
I've created a pull request to suggest a possible implementation for the above features: #7259 |
I'm +1 on just having a prebuild CLI step that runs. It's currently possible with hacky workarounds, but I think at this point feels like an obvious win. |
This is another use case that could be supported by the proposed solution at #8190 by overriding just |
Hi! In a few hours, we are deploying a new feature that will allow people to call arbitrary commands at different moments in the build process (see #9016). For example, build:
os: ubuntu-20.04
jobs:
pre_install:
- python -m bootstrap I think this new config key, |
I no longer have the need that originally inspired this request, but it does appear the |
Details
Expected Result
There would be a hook that setuptools could invoke to bootstrap the source tree prior to attempting to install it.
Actual Result
RTD attempts to install the source and fails because a bootstrap step is necessary.
In pypa/setuptools#2001, I've captured an emergent failure. After switching from
pip_install = False
topip_install = True
(in order to support extras and eventually support other features like Sphinx builds to include API docstrings), the builds no longer succeed.Setuptools has a unique condition where it needs some of its functionality available (entry point definitions) before it's able to install itself as other packages do. To accomplish this task, setuptools provides its own
./bootstrap.py
that must be invoked prior to invokingsetup.py *anything*
orpip install <source dir>
.I've looked into the custom build steps, but those seem to happen after any install step. What I desire is a hook where I can define behavior before any install.
I imagine I could build a custom RTD builder that also performs the install, and leave
pip_install=False
(or version 2 equivalent), but that feels hacky and brittle.Would it be possible to add a hook
pre_install
that if set topython -m bootstrap
would execute that prior topip install
? Do you have any other suggestions?The text was updated successfully, but these errors were encountered: