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

question about requirements.txt #53

Open
epogrebnyak opened this issue Nov 25, 2020 · 4 comments
Open

question about requirements.txt #53

epogrebnyak opened this issue Nov 25, 2020 · 4 comments

Comments

@epogrebnyak
Copy link

I have requirements.txt for my python package, but not related to documentation, the docs just depend on mkdocs and that is it. Why does Actions need to rely on requirements.txt to build docs? (I currently have a fault in numpy installation that blocks building the docs). When I rename requirements the Action passes fine.

if [ -n "${REQUIREMENTS}" ] && [ -f "${GITHUB_WORKSPACE}/${REQUIREMENTS}" ]; then
pip install -r "${GITHUB_WORKSPACE}/${REQUIREMENTS}"
else
REQUIREMENTS="${GITHUB_WORKSPACE}/requirements.txt"
if [ -f "${REQUIREMENTS}" ]; then
pip install -r "${REQUIREMENTS}"
fi
fi

@frinzekt
Copy link
Contributor

frinzekt commented Dec 5, 2020

Hi @epogrebnyak , the reason why this action may or may not need the requirements.txt file is because for custom mkdocs it may sometimes need a requirements.txt.

Eg. when including mermaid markdown

# Contents of requirements.txt
mkdocs-material
mkdocs-mermaid2-plugin

However, you do have an excellent point that some mkdoc repository especially for the basic one will not need a requirements.txt file. In terms of how to make it better for this repository, I am not quite sure, but in my humble opinion, I think changing the code to

 if  [ -f "${GITHUB_WORKSPACE}/${REQUIREMENTS}" ]; then 
     pip install -r "${GITHUB_WORKSPACE}/${REQUIREMENTS}" 
 fi 

I am not that familiar with shell scripting, so pardon me if there is a mistake here, but my idea is that to install requirements.txt the environment variable REQUIREMENTS has to be present and points to a valid requirements.txt file. What do you think @mhausenblas ?

@mhausenblas
Copy link
Owner

Sounds good, wanna PR it?

@frinzekt
Copy link
Contributor

frinzekt commented Dec 5, 2020

sure

thekaveman added a commit to cal-itp/transitstacks that referenced this issue Jun 22, 2021
mhausenblas/mkdocs-deploy-gh-pages needs a requirements file, else it
tries to install the repo-level requirements, which typically are not
needed for the docs site, see:
mhausenblas/mkdocs-deploy-gh-pages#53

introduce requirements file specific to the docs site, fixing an issue
with trying to install the dev-requirements.txt

the underlying issue was with trying to install black into the Docker
image used by this GitHub Action (squidfunk/mkdocs-material:7.1.8), see:
https://github.com/mhausenblas/mkdocs-deploy-gh-pages/blob/master/Dockerfile

recent versions of black depend on regex, which has a history of trouble
with Linux wheel availability and support

* psf/black#1207
* https://bitbucket.org/mrabarnett/mrab-regex/issues/343/wheel-for-linux
* https://bitbucket.org/mrabarnett/mrab-regex/issues/349/no-module-named-regex_regex-regex-is-not-a

the Docker image does not have gcc available; rather than installing a
build chain to build regex to enable the install of black, which isn't
even used by the docs site, the simpler fix was to create a
docs/requirements.txt and point the GitHub Action at it instead

similar report on the Action repo:
mhausenblas/mkdocs-deploy-gh-pages#105
@rekire
Copy link
Contributor

rekire commented Oct 26, 2021

This should be part of the README.md

mhausenblas pushed a commit that referenced this issue Oct 26, 2021
I found no reference how to install the required dependencies. This feature is already there but not documented, so I extended the README file.

Out of my view this resolves #12, #53 and #97

Signed-off-by: rekire <git@reki.re>
andi34 pushed a commit to andi34/mkdocs-deploy-gh-pages that referenced this issue Jan 17, 2024
I found no reference how to install the required dependencies. This feature is already there but not documented, so I extended the README file.

Out of my view this resolves mhausenblas#12, mhausenblas#53 and mhausenblas#97

Signed-off-by: rekire <git@reki.re>
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

4 participants