We welcome all kinds of contributions, including bug fixes, new features, documentation improvements, and test enhancements.
Please do not open pull requests for new features without prior discussion. Since adding a new feature to GAMSPy creates a long-term maintenance burden, it requires consensus from the GAMSPy team.
For a more detailed overview of the development workflow and tooling, please also see the Developer Guide.
git clone git@git.gams.com:devel/gamspy.git
cd gamspy
pip install .[test,dev,doc] # or uv syncThe extra dependencies install tools required for testing, development, and documentation.
We follow a standard topic-branch workflow:
- Create or find an issue describing the bug, feature, or improvement.
- Create a branch from the development branch (develop).
- Branch names should reference the issue number when possible
(e.g.187-add-new-feature).
- Branch names should reference the issue number when possible
- Make your changes with clear, focused commits.
- Run tests and formatting checks locally.
- Open a Pull Request.
- Address review feedback until approval.
We use prek to enforce consistent formatting and quality checks.
Install the hooks with:
prek installThis will automatically run checks (e.g. formatting, linting) on every commit.
- Follow PEP 8 for Python code.
- Use clear and descriptive variable and function names.
- Write docstrings (including examples) for public classes, functions, and methods.
- Keep commits small and focused.
- Prefer clarity over cleverness.
Formatting and linting are enforced via pre-commit hooks.
GAMSPy uses pytest for testing.
Run the test suite with:
pytestYou can also run specific test groups using markers:
pytest -m "unit or integration or model_library"Some tests require external services such as GAMS Engine or NEOS.
Credentials for these services can be provided via environment variables or a .env file.
Additional solvers required by some tests can be installed using the GAMSPy CLI:
gamspy install solver <solver_name1> <solver_name2>Please ensure that new features and bug fixes include appropriate test coverage.
Documentation is built using Sphinx.
To build the documentation locally:
cd docs
make htmlThe generated HTML files will be located in:
docs/_build/html
When changing functionality or adding new features, please update the documentation accordingly.
Releases can only be performed by GAMSPy team members.
To prepare a new release:
- Ensure all changes are complete and tested.
- Update the version in
pyproject.toml. - Update the version test:
tests/test_gamspy.py::test_version
- Add release notes under:
docs/release/release_<version>.rst
- Update the documentation version selector (
switcher.json). - Generate the changelog using
towncrier:
towncrier build --yes --version <new_version>You can automate most of these steps with:
python scripts/update_version.py <new_version>Merging the release branch into master triggers the publishing workflow, including building and uploading wheels to PyPI and updating documentation.
- Use the issues section for bug reports and feature requests.
- Ask questions or start discussions via issues section.
Thank you for contributing to GAMSPy!