Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add versioning controls for electron and electron-builder #43

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ channels:
- conda-forge

dependencies:
- boa
- constructor >=3.3, <4
- boa >=0.15.1
- constructor >=3.4.5
- nodejs >18, <19
- python <=3.11
- yaml
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ packages =
install_requires =
jinja2
pyyaml
constructor>=3.4.5
boa>=0.15.1
traitlets>=5

[options.package_data]
Expand Down
2 changes: 1 addition & 1 deletion src/widgetron/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "0.2.4"
VERSION = "0.2.5"
2 changes: 1 addition & 1 deletion src/widgetron/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def build_conda_package(kwargs) -> int:
if (not kwargs["skip_sbom"]) and CONSTRUCTOR_PARAMS.environment_file:
create_sbom(
CONSTRUCTOR_PARAMS.environment_file,
Path(kwargs["outdir"]) / "conda-sbom.json"
Path(kwargs["outdir"]) / "conda-sbom.json",
)
return rc

Expand Down
12 changes: 11 additions & 1 deletion src/widgetron/args.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,14 @@ default_prefix_all_users:

Set default installation prefix for All Users installation.
If not provided, the installation prefix for all users installation
will be ${ALLUSERSPROFILE}\${NAME}. Windows only.
will be ${ALLUSERSPROFILE}\${NAME}. Windows only.

# ELECTRON PARAMS
electron_version:
default: ">=25"
help: |
Version of electron to build for
electron_builder_version:
default: ">=24"
help: |
Version of electron-builder to use
1 change: 0 additions & 1 deletion src/widgetron/parse_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def config_file():
data["dependencies"] = json.loads(data["dependencies"])
return data


if Path("pyproject.toml").is_file():
_toml = tomllib.load(Path("pyproject.toml").open("rb"))
if "tool" in _toml:
Expand Down
4 changes: 2 additions & 2 deletions src/widgetron/templates/electron/package.json_template
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
},
"devDependencies": {
"@cyclonedx/cyclonedx-npm": ">=1.9.2",
"electron": ">=25",
"electron-builder": ">=24"
"electron": "{{electron_version}}",
"electron-builder": "{{electron_builder_version}}"
},
"dependencies": {
"electron-store": ">=8.1.0"
Expand Down
17 changes: 15 additions & 2 deletions src/widgetron/utils/conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,18 @@ def explicit_url(package: str, channel: str, with_hash=True, **package_attrs):
return pkg["url"]


def create_sbom(lock_file: str|Path, out_file: str|Path):
SHELL.call([JAKE, "sbom", "-f", str(lock_file), "-o", str(out_file), "--output-format", "json", "-t", "CONDA"])
def create_sbom(lock_file: str | Path, out_file: str | Path):
SHELL.call(
[
JAKE,
"sbom",
"-f",
str(lock_file),
"-o",
str(out_file),
"--output-format",
"json",
"-t",
"CONDA",
]
)
2 changes: 1 addition & 1 deletion src/widgetron/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _on_env_lock(self, e: T.Bunch) -> None:

# Check for local channels for channels_remap
lines = [x.strip() for x in content.strip().split("\n")]
urls = lines[lines.index("@EXPLICIT") + 1:]
urls = lines[lines.index("@EXPLICIT") + 1 :]
channels = []
for url in urls:
for subdir in ["noarch", cc_platform]:
Expand Down
Loading