|
| 1 | +# Contributing to scip-python |
| 2 | + |
| 3 | +- [Development](#development) |
| 4 | + - [Installing dependencies](#installing-dependencies) |
| 5 | + - [Building the code](#building-the-code) |
| 6 | + - [Running tests](#running-tests) |
| 7 | +- [Publishing releases](#publishing-releases) |
| 8 | + |
| 9 | +## Development |
| 10 | + |
| 11 | +### Installing dependencies |
| 12 | + |
| 13 | +1. Install [ASDF](https://asdf-vm.com/guide/getting-started.html). |
| 14 | +2. Install the correct versions of Node and Python: |
| 15 | + ```bash |
| 16 | + asdf plugin add nodejs |
| 17 | + asdf plugin add python |
| 18 | + # Install appropriate Node and Python versions based on .tool-versions |
| 19 | + asdf install |
| 20 | + ```` |
| 21 | +3. Install dependencies: |
| 22 | + ```bash |
| 23 | + # From the root of the repo |
| 24 | + npm install |
| 25 | + cd packages/pyright-scip |
| 26 | + npm install |
| 27 | + ``` |
| 28 | + |
| 29 | +All the other commands should be run from the `packages/pyright-scip` |
| 30 | +subdirectory. |
| 31 | + |
| 32 | +### Building the code |
| 33 | + |
| 34 | + |
| 35 | +```bash |
| 36 | +# Build in development mode once |
| 37 | +npm run webpack |
| 38 | +
|
| 39 | +# Build in development mode, watch for changes |
| 40 | +npm run watch |
| 41 | +``` |
| 42 | + |
| 43 | +To create a release build: |
| 44 | + |
| 45 | +```bash |
| 46 | +npm run build |
| 47 | +``` |
| 48 | + |
| 49 | +**WARNING:** If you create the release build and then try to run tests, |
| 50 | +you will not get useful stack traces because source maps are disabled |
| 51 | +for the release build. |
| 52 | + |
| 53 | +All of the above methods should produce an `index.js` file |
| 54 | +in `packages/pyright-scip` which can be invoked with Node |
| 55 | +to index a test project. |
| 56 | + |
| 57 | +``` |
| 58 | +node --enable-source-maps ./index.js <other args> |
| 59 | +``` |
| 60 | +
|
| 61 | +### Running tests |
| 62 | +
|
| 63 | +```bash |
| 64 | +npm run check-snapshots |
| 65 | +``` |
| 66 | + |
| 67 | +**WARNING:** At the moment, there are [some known test failures on macOS](https://github.com/sourcegraph/scip-python/issues/91). |
| 68 | + |
| 69 | +Using a different Python version other than the one specified |
| 70 | +in `.tool-versions` may also lead to errors. |
| 71 | + |
| 72 | +## Publishing releases |
| 73 | + |
| 74 | +1. Change the version in `packages/pyright/package.json` |
| 75 | + to `M.N.P` and land a PR with that. |
| 76 | +2. Add a tag `vM.N.P` to the commit on the `scip` branch |
| 77 | + and push that tag. |
0 commit comments