-
Notifications
You must be signed in to change notification settings - Fork 3
Getting started
This page explains how to set up Pynventory on your computer and walk through your first contribution.
You need:
- Python 3.8 or newer
- Git
- access to the Pynventory repository
- a terminal or command prompt
If you are new to Python or Git, see the Useful links page.
Check your installed versions:
python --version
git --versionIf python does not work, try:
python3 --versiongit clone https://github.com/blomma-dev/pynventory.git
cd pynventoryRun the commands in this guide from the repository root.
-
pynventory/- Python package with the app code -
data/- local runtime data (gitignored except.gitkeep) -
tests/- test package -
.github/- issue templates, PR template, workflows -
README.md,requirements.txt,ruff.toml,.gitignore- project files
python -m venv .venvIf python does not work, try:
python3 -m venv .venvOn Linux or macOS:
source .venv/bin/activateOn Windows PowerShell:
.venv\Scripts\Activate.ps1If PowerShell blocks activation, run PowerShell as administrator and enter:
set-executionpolicy remotesignedOn Windows Command Prompt:
.venv\Scripts\activate.batWhen active, your terminal usually shows (.venv) near the prompt.
pip install -r requirements.txtThis installs Ruff for formatting and linting.
python -m pynventory.mainYou should see the terminal app start. Useful commands inside the app:
-
help- show available commands -
add- add a product -
list- show all products -
mod- modify a product -
del- delete a product -
exit- close the app
Before opening a pull request:
ruff check .
ruff format .Only format files that are part of your change.
The app uses SQLite at data/products.db. This file contains local development data and must never be committed. If it appears in git status, leave it unstaged. See Troubleshooting for help.
The goal is not to do something big. The goal is to make one small, clear change, open a pull request, and learn the workflow.
Start with a small issue. Good first issues usually involve:
- documentation improvements
- small text fixes
- simple validation improvements
- small command-line output improvements
- simple cleanup tasks
Avoid starting with large changes such as:
- changing the database structure
- adding a web interface
- rewriting multiple files
- changing the full project architecture
If you are unsure whether an issue is a good first task, ask in the issue or on Discord.
Branches should normally be created from GitHub issues.
- Open the issue you want to work on.
- Find the Development section in the issue sidebar.
- Click Create a branch.
- Keep the default branch name unless there is a clear reason to change it.
- Copy the commands GitHub shows.
- Run those commands in your terminal.
This connects your branch to the issue and makes the work easier to track.
Keep your first contribution small. A good first pull request should:
- solve one issue
- change only the files needed for that issue
- avoid unrelated refactoring
- avoid formatting files you did not otherwise need to change
- be easy for another contributor to review
Before opening a pull request, test your change manually.
At minimum:
- run the app with
python -m pynventory.mainfrom the repository root - try the command or behavior you changed
- try at least one invalid input if your change affects user input
- confirm the app does not crash
- check
git statusbefore committing
If data/products.db appears as modified, do not include it in your pull request. See Troubleshooting for help.
When your change is ready:
- Push your branch to GitHub.
- Open a pull request into
master. - Fill in the pull request template.
- Link the issue using
Closes #issue-number. - Explain how you tested your change.
- Request a review.
Example issue link:
Closes #12
Code review is part of the learning process. You may receive comments asking you to:
- explain a choice
- rename something
- simplify code
- test another case
- make a small correction
This is normal. Review comments are about improving the work, not criticizing the person.
- Switch back to
master. - Pull the latest changes.
- Delete your old branch.
git checkout master
git pull origin masterThe best first contribution is small, clear, and finished. You do not need to understand the whole project before helping. Learning the workflow is already a valuable contribution.