We appreciate your interest in contributing to the ZenML VSCode extension! This guide will help you get started with setting up your development environment, making changes, and proposing those changes back to the project. By following these guidelines, you'll ensure a smooth and efficient contribution process.
- Fork and Clone: Fork the zenml-io/vscode-zenml repository and clone it to your local machine.
git clone https://github.com/YOUR_USERNAME/vscode-zenml.git
git checkout develop- Install Dependencies: Navigate to the cloned repository directory and install the required dependencies.
cd vscode-zenml
npm install- Compile the Project: Build the TypeScript source code into JavaScript.
npm run compileThe extension's Python functionality requires setting up a corresponding Python environment.
- Create and activate a Python virtual environment using Python 3.8 or greater. (e.g.,
python -m venv .venvon Windows, orpython3 -m venv .venvon Unix-based systems). - Install
noxfor environment management.
python -m pip install nox- Use
noxto set up the environment.
nox --session setup- Install any Python dependencies specified in
requirements.txt.
pip install -r requirements.txt- Running the Extension: Press
F5to open a new VSCode window with the extension running, or click theStart Debuggingbutton in the VSCode menubar under theRunmenu. - Making Changes: Edit the source code. The TypeScript code is in the
srcdirectory, and Python logic for the LSP server is inbundled/tool.
- Writing Tests: Add tests in the
src/testdirectory. Follow the naming convention*.test.tsfor test files. - Running Tests: Use the provided npm scripts to compile and run tests.
npm run test- VSCode Debug Console: Utilize the debug console in the VSCode development window for troubleshooting and inspecting values.
- Extension Host Logs: Review the extension host logs for runtime errors or unexpected behavior.
The project uses typos for spellchecking with a standardized configuration. Run the spellcheck script with the following command:
./scripts/spellcheck.shThe script automatically uses the repository's default config file .typos.toml in the root of the repository. Custom configurations are not supported to ensure consistent spell checking across all contributions. All arguments passed to the script (except -c/--config) are forwarded directly to typos.
We use automatic formatting and linting tools to keep our code consistent.
| Task | Command | What it does |
|---|---|---|
| Format everything | ./scripts/format.sh |
Formats all Python, TypeScript, JSON, and YAML files |
| Lint everything | ./scripts/lint.sh |
Checks all files for style/quality issues |
- Python:
rufffor formatting/linting,mypyfor type checking - TypeScript/JSON:
prettierfor formatting,eslintfor linting - YAML:
yamlfixfor formatting and checking
For frontend code only:
npm run format- Format TypeScript and JSON filesnpm run lint- Lint TypeScript files
Please run these commands before submitting your PR.
- Create a Branch: Make your changes in a new git branch based on the
developbranch.
git checkout -b feature/your-feature-name- Commit Your Changes: Write clear, concise commit messages following the conventional commit guidelines.
- Push to Your Fork: Push your branch to your fork on GitHub.
git push origin feature/your-feature-name- Open a Pull Request: Go to the original
zenml-io/vscode-zenmlrepository and create a pull request from your feature branch. Please follow our contribution guidelines for more details on proposing pull requests.
- Ensure all dependencies are up to date and compatible.
- Rebuild the project (
npm run compile) after making changes. - Reset your development environment if encountering persistent issues by re-running
noxsetup commands and reinstalling dependencies. - You can also run the
scripts/clear_and_compile.shscript, which will delete the cache,distfolder, and recompile automatically. - Check the ZenML documentation and GitHub issues for common problems and solutions.
For maintainers who need to publish new versions of the extension, please refer to our detailed Release Process Guide. This document covers:
- Testing release workflows before publishing
- Creating and tagging new releases
- Publishing to the VS Code Marketplace
- Troubleshooting common release issues