diff --git a/amplpy/vendor/CHANGELOG.md b/amplpy/vendor/CHANGELOG.md index 7da9499..0a2df14 100644 --- a/amplpy/vendor/CHANGELOG.md +++ b/amplpy/vendor/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 0.7.2-2023-12-26 +- amplpy.bundle: only include ampl.lic if "--keep-license" is set. + ## 0.7.1-2023-12-26 - Adjust ampltools.bundle to be used as amplpy.bundle. diff --git a/amplpy/vendor/ampltools/__init__.py b/amplpy/vendor/ampltools/__init__.py index d5ee368..6863fc5 100644 --- a/amplpy/vendor/ampltools/__init__.py +++ b/amplpy/vendor/ampltools/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__version__ = "0.7.1" +__version__ = "0.7.2" from .notebooks import ( ampl_notebook, ) diff --git a/amplpy/vendor/ampltools/bundle/bundle.py b/amplpy/vendor/ampltools/bundle/bundle.py index 485cb17..7e3a65a 100644 --- a/amplpy/vendor/ampltools/bundle/bundle.py +++ b/amplpy/vendor/ampltools/bundle/bundle.py @@ -16,6 +16,9 @@ def bundle(args): extra_arguments = args[1:] basename = os.path.basename(main_script).replace(".py", "") dist_dir = os.path.join(os.path.abspath(os.curdir), "dist", basename) + keep_license = "--keep-license" in args + if keep_license: + args.remove("--keep-license") if os.path.isdir(dist_dir): print(f"Deleting: {dist_dir}") @@ -50,6 +53,15 @@ def bundle(args): print(line, end="") exit_code = process.wait() + if not keep_license: + for fname in ["ampl.lic", "amplkey.log"]: + to_delete = os.path.join( + dist_dir, "_internal", "ampl_module_base", "bin", fname + ) + if os.path.isfile(to_delete): + print(f"Deleting: {to_delete}") + os.remove(to_delete) + if exit_code == 0: # Locate the executable executable = os.path.join(dist_dir, basename) diff --git a/amplpy/vendor/ampltools/modules/__init__.py b/amplpy/vendor/ampltools/modules/__init__.py index 9830b26..5dc85a5 100644 --- a/amplpy/vendor/ampltools/modules/__init__.py +++ b/amplpy/vendor/ampltools/modules/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__version__ = "0.7.1" +__version__ = "0.7.2" from .amplpypi import ( path, diff --git a/amplpy/vendor/setup.py b/amplpy/vendor/setup.py index 7a86b65..187f70e 100644 --- a/amplpy/vendor/setup.py +++ b/amplpy/vendor/setup.py @@ -24,7 +24,7 @@ def ls_dir(base_dir): setup( name="ampltools", - version="0.7.1", + version="0.7.2", description="AMPL Python Tools", long_description=__doc__, long_description_content_type="text/markdown", diff --git a/setup.py b/setup.py index 1e70053..cd9e27c 100644 --- a/setup.py +++ b/setup.py @@ -214,5 +214,5 @@ def link_args(): ) ], package_data={"": package_content()}, - install_requires=["ampltools >= 0.6.2"], + install_requires=["ampltools >= 0.7.2"], )