Skip to content

Commit

Permalink
Support missing url field
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Oct 23, 2024
1 parent da05588 commit 7f1181b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion empack/filter_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def iterate_env_pkg_meta(env_prefix):


def write_minimal_conda_meta(pkg_meta, env_prefix):
content = {k: pkg_meta[k] for k in ["name", "version", "build", "build_number", "url"]}
content = {k: pkg_meta[k] for k in ["name", "version", "build", "build_number"]}
content["url"] = pkg_meta.get("url", None)
conda_meta_dir = Path(env_prefix) / "conda-meta"
conda_meta_dir.mkdir(parents=True, exist_ok=True)

Expand Down
2 changes: 1 addition & 1 deletion empack/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def pack_env(

package_url = None
if package_url_factory:
package_url = package_url_factory(pkg_dict, source_url=pkg_meta["url"])
package_url = package_url_factory(pkg_dict, source_url=pkg_meta.get("url", None))
if package_url is not None:
pkg_dict["url"] = package_url
packages_info.append(pkg_dict)
Expand Down

0 comments on commit 7f1181b

Please sign in to comment.