From 5005cdd6e4c5293405e050d96e63800173d3336d Mon Sep 17 00:00:00 2001 From: Pantelis Sopasakis Date: Fri, 20 Mar 2026 18:48:31 +0000 Subject: [PATCH 1/6] update dependency versions --- open-codegen/setup.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/open-codegen/setup.py b/open-codegen/setup.py index cfb37c50..47b3d46f 100755 --- a/open-codegen/setup.py +++ b/open-codegen/setup.py @@ -34,14 +34,21 @@ packages=find_packages( exclude=["icasadi", "templates"]), include_package_data=True, + python_requires='>=3.12', install_requires=[ - 'jinja2', 'casadi', 'pyyaml', 'retry', 'numpy', 'setuptools' + 'jinja2>=3.1,<4', + 'casadi>=3.6,<4', + 'pyyaml>=6,<7', + 'retry>=0.9,<1', + 'numpy>=1.26,<3', ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Rust', 'Intended Audience :: Science/Research', 'Topic :: Software Development :: Libraries', @@ -50,7 +57,14 @@ 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Embedded Systems' ], - keywords=['optimization', 'nonconvex', 'embedded'], + keywords=[ + 'optimization', + 'code-generation', + 'optimal-control', + 'mpc', + 'nmpc', + 'embedded', + ], url=( 'https://github.com/alphaville/optimization-engine' ), From e4810fa3ce84471a2b1a7af708e9ab5cd87d674e Mon Sep 17 00:00:00 2001 From: Pantelis Sopasakis Date: Fri, 20 Mar 2026 18:51:58 +0000 Subject: [PATCH 2/6] from setup.py to pyproject.toml --- open-codegen/VERSION | 2 +- open-codegen/pyproject.toml | 58 +++++++++++++++++++++++++++++++ open-codegen/setup.py | 69 ++----------------------------------- 3 files changed, 61 insertions(+), 68 deletions(-) create mode 100644 open-codegen/pyproject.toml diff --git a/open-codegen/VERSION b/open-codegen/VERSION index 2774f858..ad7787f4 100644 --- a/open-codegen/VERSION +++ b/open-codegen/VERSION @@ -1 +1 @@ -0.10.0 \ No newline at end of file +0.10.1a1 \ No newline at end of file diff --git a/open-codegen/pyproject.toml b/open-codegen/pyproject.toml new file mode 100644 index 00000000..a5738e43 --- /dev/null +++ b/open-codegen/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools>=61"] +build-backend = "setuptools.build_meta" + +[project] +name = "opengen" +dynamic = ["version"] +description = "Optimization Engine Code Generator" +readme = { file = "README.md", content-type = "text/markdown" } +requires-python = ">=3.12" +authors = [ + { name = "Pantelis Sopasakis", email = "xzu.trustful191@passinbox.com" }, + { name = "Emil Fresk" }, +] +license = { text = "MIT License" } +keywords = [ + "optimization", + "code-generation", + "optimal-control", + "mpc", + "nmpc", + "embedded", +] +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.12", + "Programming Language :: Rust", + "Intended Audience :: Science/Research", + "Topic :: Software Development :: Libraries", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Software Development :: Code Generators", + "Topic :: Software Development :: Embedded Systems", +] +dependencies = [ + "jinja2>=3.1,<4", + "casadi>=3.6,<4", + "pyyaml>=6,<7", + "retry>=0.9,<1", + "numpy>=1.26,<3", +] + +[project.urls] +Homepage = "https://github.com/alphaville/optimization-engine" + +[tool.setuptools] +include-package-data = true +zip-safe = false + +[tool.setuptools.dynamic] +version = { file = ["VERSION"] } + +[tool.setuptools.packages.find] +include = ["opengen*"] diff --git a/open-codegen/setup.py b/open-codegen/setup.py index 47b3d46f..dd4e63e4 100755 --- a/open-codegen/setup.py +++ b/open-codegen/setup.py @@ -1,71 +1,6 @@ #!/usr/bin/env python -from setuptools import setup, find_packages -import io -import os +from setuptools import setup -here = os.path.abspath(os.path.dirname(__file__)) -NAME = 'opengen' - -# Import version from file -version_file = open(os.path.join(here, 'VERSION')) -VERSION = version_file.read().strip() - -DESCRIPTION = 'Optimization Engine Code Generator' - - -# Import the README and use it as the long-description. -# Note: this will only work if 'README.md' is present in your MANIFEST.in file! -try: - with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: - long_description = '\n' + f.read() -except FileNotFoundError: - long_description = DESCRIPTION - -setup(name=NAME, - version=VERSION, - description=DESCRIPTION, - long_description=long_description, - long_description_content_type='text/markdown', - author=['Pantelis Sopasakis', 'Emil Fresk'], - author_email='xzu.trustful191@passinbox.com', - license='MIT License', - packages=find_packages( - exclude=["icasadi", "templates"]), - include_package_data=True, - python_requires='>=3.12', - install_requires=[ - 'jinja2>=3.1,<4', - 'casadi>=3.6,<4', - 'pyyaml>=6,<7', - 'retry>=0.9,<1', - 'numpy>=1.26,<3', - ], - classifiers=[ - 'Development Status :: 4 - Beta', - 'License :: OSI Approved :: MIT License', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Rust', - 'Intended Audience :: Science/Research', - 'Topic :: Software Development :: Libraries', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Mathematics', - 'Topic :: Software Development :: Code Generators', - 'Topic :: Software Development :: Embedded Systems' - ], - keywords=[ - 'optimization', - 'code-generation', - 'optimal-control', - 'mpc', - 'nmpc', - 'embedded', - ], - url=( - 'https://github.com/alphaville/optimization-engine' - ), - zip_safe=False) +setup() From a611f0542180dc5ec7c3ba46e11293863991d9e2 Mon Sep 17 00:00:00 2001 From: Pantelis Sopasakis Date: Fri, 20 Mar 2026 20:05:44 +0000 Subject: [PATCH 3/6] update pyproject.toml - Add classifiers (Python 3.X) - add project URLs - req. python >= 3.10 (not 3.12) --- open-codegen/CHANGELOG.md | 8 ++++++ open-codegen/publish-pypi.sh | 55 +++++++++++++++++------------------- open-codegen/pyproject.toml | 18 +++++++++--- 3 files changed, 48 insertions(+), 33 deletions(-) mode change 100755 => 100644 open-codegen/publish-pypi.sh diff --git a/open-codegen/CHANGELOG.md b/open-codegen/CHANGELOG.md index 751bb5ba..c9098b13 100644 --- a/open-codegen/CHANGELOG.md +++ b/open-codegen/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Note: This is the Changelog file of `opengen` - the Python interface of OpEn +## [0.10.1] - Unreleased + + +### Changed + +- Introduced `pyproject.toml` for packaging the Python library; constrained the versions of dependencies therein + ## [0.10.0] - 2026-03-19 @@ -280,6 +287,7 @@ Note: This is the Changelog file of `opengen` - the Python interface of OpEn * Fixed `lbfgs` typo +[0.10.1]: https://github.com/alphaville/optimization-engine/compare/opengen-0.10.0...opengen-0.10.1 [0.10.0]: https://github.com/alphaville/optimization-engine/compare/opengen-0.9.6...opengen-0.10.0 [0.9.6]: https://github.com/alphaville/optimization-engine/compare/opengen-0.9.5...opengen-0.9.6 [0.9.5]: https://github.com/alphaville/optimization-engine/compare/opengen-0.9.4...opengen-0.9.5 diff --git a/open-codegen/publish-pypi.sh b/open-codegen/publish-pypi.sh old mode 100755 new mode 100644 index 4cf4cbec..1feca85b --- a/open-codegen/publish-pypi.sh +++ b/open-codegen/publish-pypi.sh @@ -1,45 +1,42 @@ #!/bin/sh -# This is a script to faciliate the release of new versions -# Make sure you have created a virtual environment, `venv` -# and that you have installed twine - +set -eu + +# This script facilitates releasing a new version of opengen to PyPI. +# It expects a local virtual environment at ./venv with publishing tools. + echo "[OpEnGen] Checking out master" git checkout master git pull origin master -echo "[OpEnGen] Clean build" -rm -rf ./build ./dist opengen.egg-info +echo "[OpEnGen] Cleaning previous build artifacts" +rm -rf ./build ./dist ./opengen.egg-info + +echo "[OpEnGen] Activating virtual environment" +. venv/bin/activate -echo "[OpEnGen] Build (within a virtual environment)" -source venv/bin/activate -pip install . +echo "[OpEnGen] Installing packaging tools" +python -m pip install --upgrade pip build twine -echo "[OpEnGen] Build dist" -python setup.py sdist bdist_wheel +echo "[OpEnGen] Building source and wheel distributions" +python -m build -echo "[OpEnGen] Check..." -ok=`twine check dist/** | grep PASSED | wc -l` -echo $ok -if [ $ok -eq 2 ]; then - echo "[OpEnGen] twine check: all passed" -else - echo "[OpEnGen] twine: some checks did not pass" - exit 2 -fi +echo "[OpEnGen] Checking distributions with twine" +python -m twine check dist/* -echo "[OpEnGen] Uploading to pypi..." -read -r -p "Are you sure? [y/N] " response +echo "[OpEnGen] Uploading to PyPI..." +printf "Are you sure? [y/N] " +read -r response case "$response" in - [yY][eE][sS]|[yY]) - echo "[OpEnGen] Thanks, uploading to PyPi now" - twine upload dist/* + [yY][eE][sS]|[yY]) + echo "[OpEnGen] Uploading to PyPI now" + python -m twine upload dist/* ;; *) - echo "---" + echo "[OpEnGen] Upload cancelled" ;; esac echo "[OpEnGen] Don't forget to create a tag; run:" -a=`cat VERSION` -echo "\$ git tag -a opengen-$a -m 'opengen-$a'" -echo "\$ git push --tags" \ No newline at end of file +version=$(cat VERSION) +echo "\$ git tag -a opengen-$version -m 'opengen-$version'" +echo "\$ git push --tags" diff --git a/open-codegen/pyproject.toml b/open-codegen/pyproject.toml index a5738e43..df6ded5a 100644 --- a/open-codegen/pyproject.toml +++ b/open-codegen/pyproject.toml @@ -7,12 +7,12 @@ name = "opengen" dynamic = ["version"] description = "Optimization Engine Code Generator" readme = { file = "README.md", content-type = "text/markdown" } -requires-python = ">=3.12" +requires-python = ">=3.10" authors = [ { name = "Pantelis Sopasakis", email = "xzu.trustful191@passinbox.com" }, { name = "Emil Fresk" }, ] -license = { text = "MIT License" } +license = "MIT OR Apache-2.0" keywords = [ "optimization", "code-generation", @@ -23,11 +23,12 @@ keywords = [ ] classifiers = [ "Development Status :: 4 - Beta", - "License :: OSI Approved :: MIT License", - "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Rust", "Intended Audience :: Science/Research", "Topic :: Software Development :: Libraries", @@ -46,6 +47,15 @@ dependencies = [ [project.urls] Homepage = "https://github.com/alphaville/optimization-engine" +Documentation = "https://alphaville.github.io/optimization-engine/" +Repository = "https://github.com/alphaville/optimization-engine" +Changelog = "https://github.com/alphaville/optimization-engine/blob/master/open-codegen/CHANGELOG.md" + +[project.optional-dependencies] +dev = [ + "build>=1", + "twine>=5", +] [tool.setuptools] include-package-data = true From e73e631081dff925fa3a6bdbbd866fe368cdd795 Mon Sep 17 00:00:00 2001 From: Pantelis Sopasakis Date: Fri, 20 Mar 2026 22:58:11 +0000 Subject: [PATCH 4/6] update PR template --- .github/pull_request_template.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6a6a323d..8ab25874 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,6 @@ ## Main Changes -- Describe main changes +Give a summary of the key changes ## Associated Issues @@ -8,11 +8,16 @@ - Closes #1 - Addresses #2 +## Merge Dependencies -## TODOs +- Either: this PR has no merge dependencies, or +- Depends on: ... +- Should be merged before: ... -- [ ] Documentation -- [ ] All tests must pass +## Checklist + +- [ ] API documentation updated +- [ ] Appropriate testing - [ ] Update `CHANGELOG`(s) -- [ ] Update webpage documentation -- [ ] Bump versions (in `CHANGELOG`, `Cargo.toml` and `VERSION`) +- [ ] Update webpage documentation, if necessary +- [ ] Bump versions (in `CHANGELOG`, `Cargo.toml` and `VERSION`), if necessary From 7916fa76bac74a8cf517442a8bc043becedcd871 Mon Sep 17 00:00:00 2001 From: Pantelis Sopasakis Date: Wed, 25 Mar 2026 15:56:55 +0000 Subject: [PATCH 5/6] [ci skip] update opengen version (0.10.1) --- open-codegen/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-codegen/VERSION b/open-codegen/VERSION index ad7787f4..71172b43 100644 --- a/open-codegen/VERSION +++ b/open-codegen/VERSION @@ -1 +1 @@ -0.10.1a1 \ No newline at end of file +0.10.1 \ No newline at end of file From 9e41f0111af8b1bdaa7a0d2312f4f46b8a50f2b6 Mon Sep 17 00:00:00 2001 From: Pantelis Sopasakis Date: Wed, 25 Mar 2026 15:58:08 +0000 Subject: [PATCH 6/6] [ci skip] update opengen changelog --- open-codegen/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/open-codegen/CHANGELOG.md b/open-codegen/CHANGELOG.md index c9098b13..75b7a86d 100644 --- a/open-codegen/CHANGELOG.md +++ b/open-codegen/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Note: This is the Changelog file of `opengen` - the Python interface of OpEn -## [0.10.1] - Unreleased + +## [0.10.1] - 2026-03-25 ### Changed