Skip to content

Latest commit

 

History

History
100 lines (67 loc) · 3.75 KB

CONTRIBUTING.md

File metadata and controls

100 lines (67 loc) · 3.75 KB

Contributing to ZenML VSCode Extension

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.

Setting Up Your Development Environment

  1. 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
  1. Install Dependencies: Navigate to the cloned repository directory and install the required dependencies.
cd vscode-zenml
npm install
  1. Compile the Project: Build the TypeScript source code into JavaScript.
npm run compile

Python Environment Setup

The extension's Python functionality requires setting up a corresponding Python environment.

  1. Create and activate a Python virtual environment using Python 3.8 or greater. (e.g., python -m venv .venv on Windows, or python3 -m venv .venv on Unix-based systems).
  2. Install nox for environment management.
python -m pip install nox
  1. Use nox to set up the environment.
nox --session setup
  1. Install any Python dependencies specified in requirements.txt.
pip install -r requirements.txt

Development Workflow

  • Running the Extension: Press F5 to open a new VSCode window with the extension running, or click the Start Debugging button in the VSCode menubar under the Run menu.
  • Making Changes: Edit the source code. The TypeScript code is in the src directory, and Python logic for the LSP server is in bundled/tool.

Testing

  • Writing Tests: Add tests in the src/test directory. Follow the naming convention *.test.ts for test files.
  • Running Tests: Use the provided npm scripts to compile and run tests.
npm run test

Debugging

  • 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.

Contributing Changes

  1. Create a Branch: Make your changes in a new git branch based on the develop branch.
git checkout -b feature/your-feature-name
  1. Commit Your Changes: Write clear, concise commit messages following the conventional commit guidelines.
  2. Push to Your Fork: Push your branch to your fork on GitHub.
git push origin feature/your-feature-name
  1. Open a Pull Request: Go to the original zenml-io/vscode-zenml repository and create a pull request from your feature branch. Please follow our contribution guidelines for more details on proposing pull requests.

Troubleshooting Common Issues

  • 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 nox setup commands and reinstalling dependencies.
  • You can also run the scripts/clear_and_compile.sh script, which will delete the cache, dist folder, and recompile automatically.
  • Check the ZenML documentation and GitHub issues for common problems and solutions.

Additional Resources