{"_id":"@atom/dowsing-rod","_rev":"7-fb93776109ff15b02a814731724183a9","name":"@atom/dowsing-rod","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@atom/dowsing-rod","version":"1.0.0","description":"Dowse for compatible Python 2 installations to run node-gyp","main":"index.js","scripts":{"test":"mocha"},"bin":{"with-python2-env":"./with-python2-env.js"},"keywords":["node-gyp","python"],"author":{"name":"Ash Wilson","email":"smashwilson@gmail.com"},"license":"MIT","dependencies":{"semver":"^5.5.0"},"gitHead":"e51325f8f41d3bd4457be3f6bb0a14b186da90c1","_id":"@atom/dowsing-rod@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"smashwilson","email":"smashwilson@gmail.com"},"dist":{"integrity":"sha512-5S3ge6mYQyKAd+l6JgxV0iXdlL4DLOUopPrv9ZY7ETrQR0tYUYyY2agUy5tZsA41JNIRulsJyMeTaYR6ytx+gA==","shasum":"3cc9856043f3f5fb06e2a926bac3975fa3a7d62c","tarball":"https://registry.npmjs.org/@atom/dowsing-rod/-/dowsing-rod-1.0.0.tgz","fileCount":8,"unpackedSize":9326,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICVh6Dq/35H7ED05jGFrXzyPsfnwD81yzM6TV4+qPdymAiEAozZvzNEDNu90RjhiconxqNsyn5MXBUIQCLG0JSCNQE0="}]},"maintainers":[{"name":"as-cii","email":"as-cii@github.com"},{"name":"atom-team","email":"atom@github.com"},{"name":"binarymuse","email":"michelle@michelletilley.net"},{"name":"damieng","email":"damieng@gmail.com"},{"name":"daviwil","email":"daviwil@github.com"},{"name":"donokuda","email":"helloyesthisisdon@gmail.com"},{"name":"iolsen","email":"ian.olsen@gmail.com"},{"name":"jasonrudolph","email":"jason@jasonrudolph.com"},{"name":"kuychaco","email":"kuychaco@gmail.com"},{"name":"lee-dohm","email":"lee@lee-dohm.com"},{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"nathansobo","email":"nathan@github.com"},{"name":"simurai","email":"sim@simurai.com"},{"name":"smashwilson","email":"smashwilson@gmail.com"},{"name":"ungb","email":"ungb@github.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dowsing-rod_1.0.0_1520129918173_0.46098464343998047"},"_hasShrinkwrap":false},"1.0.1":{"name":"@atom/dowsing-rod","version":"1.0.1","description":"Dowse for compatible Python 2 installations to run node-gyp","repository":{"type":"git","url":"git+https://github.com/atom/dowsing-rod.git"},"main":"index.js","scripts":{"test":"mocha"},"bin":{"with-python2-env":"./with-python2-env.js"},"keywords":["node-gyp","python"],"author":{"name":"Ash Wilson","email":"smashwilson@gmail.com"},"license":"MIT","dependencies":{"semver":"^5.5.0"},"gitHead":"7bd787e4ed64abe42d32ceb1337f520a533d21d4","bugs":{"url":"https://github.com/atom/dowsing-rod/issues"},"homepage":"https://github.com/atom/dowsing-rod#readme","_id":"@atom/dowsing-rod@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"smashwilson","email":"smashwilson@gmail.com"},"dist":{"integrity":"sha512-WKSKlqMHSURRstKn4tZy91QezDdYvQLFPu68ZjC7COKElVUp5Pgj8Pfns9EFHW6DKHrTXxSagi/eS469rXm75Q==","shasum":"940757ae4aa58d04d9465f30fa22aa2b677b8d71","tarball":"https://registry.npmjs.org/@atom/dowsing-rod/-/dowsing-rod-1.0.1.tgz","fileCount":8,"unpackedSize":9369,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICegJPTGy0eIn4X3MuIB08em54rRh0EP1PwJtQB1vJsjAiEA7cNRZ2W2slphb1udcQfzjb8ZrioElvVT4WcwoZCv/wA="}]},"maintainers":[{"name":"as-cii","email":"as-cii@github.com"},{"name":"atom-team","email":"atom@github.com"},{"name":"binarymuse","email":"michelle@michelletilley.net"},{"name":"damieng","email":"damieng@gmail.com"},{"name":"daviwil","email":"daviwil@github.com"},{"name":"donokuda","email":"helloyesthisisdon@gmail.com"},{"name":"iolsen","email":"ian.olsen@gmail.com"},{"name":"jasonrudolph","email":"jason@jasonrudolph.com"},{"name":"kuychaco","email":"kuychaco@gmail.com"},{"name":"lee-dohm","email":"lee@lee-dohm.com"},{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"nathansobo","email":"nathan@github.com"},{"name":"simurai","email":"sim@simurai.com"},{"name":"smashwilson","email":"smashwilson@gmail.com"},{"name":"ungb","email":"ungb@github.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dowsing-rod_1.0.1_1520130624943_0.9803003766685139"},"_hasShrinkwrap":false},"1.1.0":{"name":"@atom/dowsing-rod","version":"1.1.0","description":"Dowse for compatible Python 2 installations to run node-gyp","repository":{"type":"git","url":"git+https://github.com/atom/dowsing-rod.git"},"main":"index.js","scripts":{"test":"mocha"},"bin":{"with-python2-env":"./with-python2-env.js"},"keywords":["node-gyp","python"],"author":{"name":"Ash Wilson","email":"smashwilson@gmail.com"},"license":"MIT","dependencies":{"semver":"^5.5.0"},"gitHead":"54953f59c07809f2d35de0ea46f5533653d8037e","bugs":{"url":"https://github.com/atom/dowsing-rod/issues"},"homepage":"https://github.com/atom/dowsing-rod#readme","_id":"@atom/dowsing-rod@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"smashwilson","email":"smashwilson@gmail.com"},"dist":{"integrity":"sha512-4pkS7pr1AnvP0nSk9/EHdQUsACKDQ1E+O+KgB9KWoP8kLFxt4Zv+jtk7j/r5n+FuINq/PokuJT9jWqkOHQ2imA==","shasum":"e8840cf267d1155acd9bec6421355381df9a43d8","tarball":"https://registry.npmjs.org/@atom/dowsing-rod/-/dowsing-rod-1.1.0.tgz","fileCount":9,"unpackedSize":13176,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQpIk7DpVMgaEqw+wCD0Di5zUP/wTZvbQYR0en24PuLgIhAKVumabwjWEVnHdHTcgABpn+yu4aPmwaMek9t5oBPy3i"}]},"maintainers":[{"name":"as-cii","email":"as-cii@github.com"},{"name":"atom-team","email":"atom@github.com"},{"name":"binarymuse","email":"michelle@michelletilley.net"},{"name":"damieng","email":"damieng@gmail.com"},{"name":"daviwil","email":"daviwil@github.com"},{"name":"donokuda","email":"helloyesthisisdon@gmail.com"},{"name":"iolsen","email":"ian.olsen@gmail.com"},{"name":"jasonrudolph","email":"jason@jasonrudolph.com"},{"name":"kuychaco","email":"kuychaco@gmail.com"},{"name":"lee-dohm","email":"lee@lee-dohm.com"},{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"nathansobo","email":"nathan@github.com"},{"name":"simurai","email":"sim@simurai.com"},{"name":"smashwilson","email":"smashwilson@gmail.com"},{"name":"ungb","email":"ungb@github.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dowsing-rod_1.1.0_1520265975803_0.45601102721602293"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-04T02:18:38.173Z","1.0.0":"2018-03-04T02:18:38.219Z","modified":"2022-04-04T16:14:25.796Z","1.0.1":"2018-03-04T02:30:24.998Z","1.1.0":"2018-03-05T16:06:15.946Z"},"maintainers":[{"email":"mazen.elkashef@gmail.com","name":"kashef"},{"email":"daviwil@github.com","name":"daviwil"},{"email":"michelle@michelletilley.net","name":"binarymuse"},{"email":"kuychaco@gmail.com","name":"kuychaco"},{"email":"atom@github.com","name":"atom-team"},{"email":"smashwilson@gmail.com","name":"smashwilson"},{"email":"nathan@github.com","name":"nathansobo"},{"email":"maxbrunsfeld@gmail.com","name":"maxbrunsfeld"},{"email":"sim@simurai.com","name":"simurai"},{"email":"ian.olsen@gmail.com","name":"iolsen"},{"email":"as-cii@github.com","name":"as-cii"},{"email":"jason@jasonrudolph.com","name":"jasonrudolph"},{"email":"lee@lee-dohm.com","name":"lee-dohm"},{"email":"helloyesthisisdon@gmail.com","name":"donokuda"}],"description":"Dowse for compatible Python 2 installations to run node-gyp","keywords":["node-gyp","python"],"author":{"name":"Ash Wilson","email":"smashwilson@gmail.com"},"license":"MIT","readme":"# Dowsing Rod\n\nDowse for Python 2.7 installations on your system and make them available to `node-gyp` subprocesses.\n\n## Why?\n\n`node-gyp` only works with Python 2, and this is unlikely to change in the near future.\n\nFurthermore, while `node-gyp` allows you to override the Python executable it discovers itself by specifying a `PYTHON` environment variable or setting the `python` npm config option, certain `node-gyp` builds will _only_ work correctly if the python 2 executable is on the `${PATH}` with the exact name \"python\", because the Makefiles they generate execute generated files with a shebang line of `#!/usr/bin/env python`.\n\nFixing this upstream would be tricky and require changes to trickle through a number of dependent projects. Hence @atom/dowsing-rod, which exists to:\n\n* Locate a compatible Python 2 executable _(a)_ from an existing `$PYTHON` variable _(b)_ as any `python`, `python2`, or `python2.7` executable on your `$PATH` or _(c)_ specified directly as a `.python2-bin` file.\n* Set the `$PYTHON` environment variable to the discovered binary's path. Prepend a directory containing a wrapper script to your `$PATH` so that shebang scripts will execute your chosen Python binary properly.\n\n## Install\n\n```sh\n$ npm install @atom/dowsing-rod\n```\n\nYou'll also likely want to add `.python2-bin` to your `.gitignore`:\n\n```sh\n$ echo '.python2-bin' >> .gitignore\n```\n\n## Use\n\n### From your package.json\n\nTo fix your `node-gyp rebuild` command, add the following to your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"install\": \"with-python2-env node-gyp rebuild\"\n  }\n}\n```\n\n### From code\n\nIf you're launching node-gyp as a subprocess yourself (like we do within the :atom: build scripts, for example), you can modify your process' environment directly:\n\n```js\nconst path = require('path')\nconst dowsingRod = require('@atom/dowsing-rod')\n\nconst options = {\n  // npm binary used to read config settings\n  npmBin: 'npm',\n\n  // file to store located Python binary\n  pythonBinFile: path.join(process.cwd(), '.python2-bin')\n}\n\n// Options are optional with the defaults shown.\nconst promise = dowsingRod.setPythonEnv(options, process.env)\n\n// Any exec or spawn calls after the returned promise resolves will have the correct Python environments.\n// Or, if you wish to do something with the path yourself:\n\ndowsingRod.getPythonBin(options)\n  .then(pythonBin => console.log(`Python binary: ${pythonBin}`))\n\n// Synchronous variants are also exported:\ndowsingRod.setPythonEnvSync(options, process.env)\nconst pythonBin = dowsingRod.getPythonBinSync(options)\n```\n","readmeFilename":"README.md","homepage":"https://github.com/atom/dowsing-rod#readme","repository":{"type":"git","url":"git+https://github.com/atom/dowsing-rod.git"},"bugs":{"url":"https://github.com/atom/dowsing-rod/issues"}}