Skip to content

Commit 3046105

Browse files
authored
Pass package source URL to URL factory (#109)
* Save package source URL to lockfile * Pass source url to factory function * Fix test
1 parent 99b1b76 commit 3046105

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

empack/filter_env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def iterate_env_pkg_meta(env_prefix):
7373

7474

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

empack/pack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def pack_env(
209209

210210
package_url = None
211211
if package_url_factory:
212-
package_url = package_url_factory(pkg_dict)
212+
package_url = package_url_factory(pkg_dict, source_url=pkg_meta["url"])
213213
if package_url is not None:
214214
pkg_dict["url"] = package_url
215215
packages_info.append(pkg_dict)

tests/test_pack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_pack_env_with_url(tmp_path):
177177
platform="emscripten-wasm32",
178178
)
179179

180-
def url_factory(pkg):
180+
def url_factory(pkg, *args, **kwargs):
181181
return f'http://localhost:1234/{pkg["filename"]}'
182182

183183
pack_env(

0 commit comments

Comments
 (0)