This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
[BUGFIX]Fix chdir Error when invoked from Makefile #1193
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a bug fix, rather than an enhancement.
Currently this file is invoked smoothly from CI, because CI passes the full path as the argument to this python script. However, when invoked from Makefile, using the command
make docs
, only file name is passed to this file, resulting in theinput_dir
variable to be empty string, so that theos.chdir()
will fail.More detailed explanation:
When we use
make docs
, the L60 ofMakefile
will be executed, and then L86 ofMakefile
will be executed. See in L89, variableBASENAME
will be the file name and variableDIR
will be the directory. In L96, onlyBASENAME
is passed toMD2IPYNB
as an argument. So there will be error in the python file.With this fix, the python script doesn't need to change directory explicitly because in L92 of the
Makefile
, the directory is changed already. So this fix will work fine.This pull request is compatible with the existing CI, and can make Makefile work fine again.
Checklist
Essentials
Changes
Comments
cc @dmlc/gluon-nlp-team