| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c181ffa commit 878156f
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6422,6 +6422,7 @@ var __importStar = (this && this.__importStar) || function (mod) { | |||
| 6422 | 6422 | return result; | |
| 6423 | 6423 | }; | |
| 6424 | 6424 | Object.defineProperty(exports, "__esModule", { value: true }); | |
| 6425 | + const path = __importStar(__webpack_require__(622)); | ||
| 6425 | 6426 | const core = __importStar(__webpack_require__(470)); | |
| 6426 | 6427 | const tc = __importStar(__webpack_require__(533)); | |
| 6427 | 6428 | const exec = __importStar(__webpack_require__(986)); | |
@@ -6432,6 +6433,7 @@ const MANIFEST_REPO_NAME = 'python-versions'; | |||
| 6432 | 6433 | const MANIFEST_REPO_BRANCH = 'main'; | |
| 6433 | 6434 | exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; | |
| 6434 | 6435 | const IS_WINDOWS = process.platform === 'win32'; | |
| 6436 | + const IS_LINUX = process.platform === 'linux'; | ||
| 6435 | 6437 | function findReleaseFromManifest(semanticVersionSpec, architecture) { | |
| 6436 | 6438 | return __awaiter(this, void 0, void 0, function* () { | |
| 6437 | 6439 | const manifest = yield tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH); | |
@@ -6443,6 +6445,7 @@ function installPython(workingDirectory) { | |||
| 6443 | 6445 | return __awaiter(this, void 0, void 0, function* () { | |
| 6444 | 6446 | const options = { | |
| 6445 | 6447 | cwd: workingDirectory, | |
| 6448 | + env: Object.assign(Object.assign({}, process.env), IS_LINUX && { 'LD_LIBRARY_PATH': path.join(workingDirectory, 'lib') }), | ||
| 6446 | 6449 | silent: true, | |
| 6447 | 6450 | listeners: { | |
| 6448 | 6451 | stdout: (data) => { | |
@@ -6688,6 +6691,7 @@ const installer = __importStar(__webpack_require__(824)); | |||
| 6688 | 6691 | const core = __importStar(__webpack_require__(470)); | |
| 6689 | 6692 | const tc = __importStar(__webpack_require__(533)); | |
| 6690 | 6693 | const IS_WINDOWS = process.platform === 'win32'; | |
| 6694 | + const IS_LINUX = process.platform === 'linux'; | ||
| 6691 | 6695 | // Python has "scripts" or "bin" directories where command-line tools that come with packages are installed. | |
| 6692 | 6696 | // This is where pip is, along with anything that pip installs. | |
| 6693 | 6697 | // There is a seperate directory for `pip install --user`. | |
@@ -6760,6 +6764,13 @@ function useCpythonVersion(version, architecture) { | |||
| 6760 | 6764 | ].join(os.EOL)); | |
| 6761 | 6765 | } | |
| 6762 | 6766 | core.exportVariable('pythonLocation', installDir); | |
| 6767 | + if (IS_LINUX) { | ||
| 6768 | + const libPath = (process.env.LD_LIBRARY_PATH) ? `:${process.env.LD_LIBRARY_PATH}` : ''; | ||
| 6769 | + const pyLibPath = path.join(installDir, 'lib'); | ||
| 6770 | + if (!libPath.split(':').includes(pyLibPath)) { | ||
| 6771 | + core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath); | ||
| 6772 | + } | ||
| 6773 | + } | ||
| 6763 | 6774 | core.addPath(installDir); | |
| 6764 | 6775 | core.addPath(binDir(installDir)); | |
| 6765 | 6776 | if (IS_WINDOWS) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,12 +13,14 @@ In order to avoid uploading `node_modules/` to the repository, we use [vercel/nc | |||
| 13 | 13 | ### Developing | |
| 14 | 14 | ||
| 15 | 15 | If you're developing locally, you can run | |
| 16 | - ``` | ||
| 16 | + | ||
| 17 | + ```sh | ||
| 17 | 18 | npm install | |
| 18 | 19 | tsc | |
| 19 | 20 | ncc build src/setup-python.ts | |
| 20 | 21 | ``` | |
| 21 | - Any files generated using `tsc` will be added to `lib/`, however those files also are not uploaded to the repository and are exluded using `.gitignore`. | ||
| 22 | + | ||
| 23 | + Any files generated using `tsc` will be added to `lib/`, however those files also are not uploaded to the repository and are excluded using `.gitignore`. | ||
| 22 | 24 | ||
| 23 | 25 | During the commit step, Husky will take care of formatting all files with [Prettier](https://github.com/prettier/prettier) (to run manually, use `npm run format`). | |
| 24 | 26 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ import * as core from '@actions/core'; | |||
| 9 | 9 | import * as tc from '@actions/tool-cache'; | |
| 10 | 10 | ||
| 11 | 11 | const IS_WINDOWS = process.platform === 'win32'; | |
| 12 | + const IS_LINUX = process.platform === 'linux'; | ||
| 12 | 13 | ||
| 13 | 14 | // Python has "scripts" or "bin" directories where command-line tools that come with packages are installed. | |
| 14 | 15 | // This is where pip is, along with anything that pip installs. | |
@@ -109,6 +110,18 @@ async function useCpythonVersion( | |||
| 109 | 110 | } | |
| 110 | 111 | ||
| 111 | 112 | core.exportVariable('pythonLocation', installDir); | |
| 113 | + | ||
| 114 | + if (IS_LINUX) { | ||
| 115 | + const libPath = process.env.LD_LIBRARY_PATH | ||
| 116 | + ? `:${process.env.LD_LIBRARY_PATH}` | ||
| 117 | + : ''; | ||
| 118 | + const pyLibPath = path.join(installDir, 'lib'); | ||
| 119 | + | ||
| 120 | + if (!libPath.split(':').includes(pyLibPath)) { | ||
| 121 | + core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath); | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + | ||
| 112 | 125 | core.addPath(installDir); | |
| 113 | 126 | core.addPath(binDir(installDir)); | |
| 114 | 127 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ const MANIFEST_REPO_BRANCH = 'main'; | |||
| 13 | 13 | export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; | |
| 14 | 14 | ||
| 15 | 15 | const IS_WINDOWS = process.platform === 'win32'; | |
| 16 | + const IS_LINUX = process.platform === 'linux'; | ||
| 16 | 17 | ||
| 17 | 18 | export async function findReleaseFromManifest( | |
| 18 | 19 | semanticVersionSpec: string, | |
@@ -35,6 +36,10 @@ export async function findReleaseFromManifest( | |||
| 35 | 36 | async function installPython(workingDirectory: string) { | |
| 36 | 37 | const options: ExecOptions = { | |
| 37 | 38 | cwd: workingDirectory, | |
| 39 | + env: { | ||
| 40 | + ...process.env, | ||
| 41 | + ...(IS_LINUX && {LD_LIBRARY_PATH: path.join(workingDirectory, 'lib')}) | ||
| 42 | + }, | ||
| 38 | 43 | silent: true, | |
| 39 | 44 | listeners: { | |
| 40 | 45 | stdout: (data: Buffer) => { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments