Skip to content

Commit

Permalink
ampltools: release version 0.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fdabrandao committed Dec 26, 2023
1 parent 7662879 commit e478c72
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions amplpy/vendor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion amplpy/vendor/ampltools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "0.7.1"
__version__ = "0.7.2"
from .notebooks import (
ampl_notebook,
)
Expand Down
12 changes: 12 additions & 0 deletions amplpy/vendor/ampltools/bundle/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion amplpy/vendor/ampltools/modules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "0.7.1"
__version__ = "0.7.2"

from .amplpypi import (
path,
Expand Down
2 changes: 1 addition & 1 deletion amplpy/vendor/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,5 @@ def link_args():
)
],
package_data={"": package_content()},
install_requires=["ampltools >= 0.6.2"],
install_requires=["ampltools >= 0.7.2"],
)

0 comments on commit e478c72

Please sign in to comment.