-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ourstage): techdocs python dependencies
Signed-off-by: OurchitectureIO <97544811+ourchitectureio@users.noreply.github.com>
- Loading branch information
1 parent
5a4713a
commit e192a0b
Showing
7 changed files
with
190 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/systems/dev/backstage/ourstage/install-dependencies-python.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const main = async () => { | ||
require('dotenv').config(); | ||
|
||
const glob = (await import('glob')).glob; | ||
const execa = (await import('execa')).execa; | ||
|
||
console.log('Installing ourstage python dependencies...'); | ||
|
||
const pythonCommand = process.env.PYTHON3; | ||
const pipIndexUrl = process.env.PIP_INDEX_URL; | ||
|
||
const upgradePipArgv = [ | ||
'-m', | ||
'pip', | ||
'install', | ||
'--index-url', | ||
pipIndexUrl, | ||
'--upgrade', | ||
'pip', | ||
]; | ||
|
||
const upgradePipResult = await execa(pythonCommand, upgradePipArgv, { | ||
cleanup: true, | ||
env: process.env, | ||
shell: false, | ||
stderr: process.stderr, | ||
stdout: process.stdout, | ||
stripFinalNewline: true, | ||
}); | ||
|
||
if (upgradePipResult.failed) { | ||
throw new Error('Failed to upgrade pip.'); | ||
} | ||
|
||
const pipInstallDependenciesArgv = [ | ||
'-m', | ||
'pip', | ||
'install', | ||
'--index-url', | ||
`"${pipIndexUrl}"`, | ||
'--requirement', | ||
'./techdocs.requirements.txt', | ||
]; | ||
|
||
const pipInstallDependenciesResult = await execa( | ||
pythonCommand, | ||
pipInstallDependenciesArgv, | ||
{ | ||
cleanup: true, | ||
env: process.env, | ||
shell: false, | ||
stderr: process.stderr, | ||
stdout: process.stdout, | ||
stripFinalNewline: true, | ||
}, | ||
); | ||
|
||
if (pipInstallDependenciesResult.failed) { | ||
throw new Error('Failed to install python dependencies.'); | ||
} | ||
|
||
console.log('Successfully installed ourstage python dependencies.'); | ||
}; | ||
|
||
(async () => { | ||
await main(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
mkdocs==1.5.3 | ||
|
||
# Caveat: Please install the mkdocs-techdocs-core package after all other | ||
# Python packages. The order is important to make sure we get correct | ||
# version of some of the dependencies. | ||
# Source: https://backstage.io/docs/features/techdocs/getting-started#disabling-docker-in-docker-situation-optional | ||
mkdocs-techdocs-core==1.3.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters