jupyter_releaser icon indicating copy to clipboard operation
jupyter_releaser copied to clipboard

Support package release dependencies in multi-Python packages

Open davidbrochart opened this issue 3 years ago • 22 comments
trafficstars

Closes #371.

This fails with check-python, extract-release... because the dependent packages have not been released on PyPI yet. Maybe there is a way to add the just-created (local) releases in the package providers?

davidbrochart avatar Sep 05 '22 16:09 davidbrochart

Yeah, I finally figured out how to test local changes in #363. Perhaps we should wait for that before doing this?

blink1073 avatar Sep 06 '22 02:09 blink1073

Perhaps we should wait for that before doing this?

Sounds good. In the meantime, I can always achieve what this PR does in two steps:

  • make a first release with version x.y.z.
  • pin sub-packages with ==x.y.z, and release again.

davidbrochart avatar Sep 06 '22 06:09 davidbrochart

Okay, you can rebase now that #363 is merged.

blink1073 avatar Sep 12 '22 01:09 blink1073

Codecov Report

Merging #372 (2651a46) into main (2cd3e74) will decrease coverage by 0.32%. The diff coverage is 58.33%.

@@            Coverage Diff             @@
##             main     #372      +/-   ##
==========================================
- Coverage   82.93%   82.60%   -0.33%     
==========================================
  Files          21       21              
  Lines        2866     2898      +32     
  Branches      374      382       +8     
==========================================
+ Hits         2377     2394      +17     
- Misses        356      368      +12     
- Partials      133      136       +3     
Impacted Files Coverage Δ
jupyter_releaser/lib.py 78.68% <51.61%> (-2.15%) :arrow_down:
jupyter_releaser/cli.py 91.00% <100.00%> (+0.09%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Sep 12 '22 07:09 codecov-commenter

I rebased an tried to release jupyverse with this branch, but it failed in check-changelog with:

fatal: malformed object name refs/heads/release_deps

Any idea?

davidbrochart avatar Sep 12 '22 07:09 davidbrochart

Ah, I see that we need to store the RH_REF in the metadata file and use that.

blink1073 avatar Sep 12 '22 13:09 blink1073

https://github.com/jupyter-server/jupyter_releaser/pull/375

blink1073 avatar Sep 12 '22 13:09 blink1073

I rebased on #375, but it still fails.

davidbrochart avatar Sep 12 '22 14:09 davidbrochart

With the latest changes in #375, it fails at "Publish Release" in "Prepare Environment":

ValueError: No release found for url https://github.com/jupyter-server/jupyverse/releases/tag/untagged-3ab212a9b6e7bceff24f

But it could be because of my changes.

davidbrochart avatar Sep 12 '22 15:09 davidbrochart

I think it is because the original draft release was over one day old and got pruned. You'll have to start over.

blink1073 avatar Sep 12 '22 16:09 blink1073

Oh, I see it is still there. Maybe try with the full url: https://github.com/jupyter-server/jupyverse/releases/tag/untagged-43adf70df0043151e18b

blink1073 avatar Sep 12 '22 16:09 blink1073

Still fails:

--------------------------------------------------
bump-version
--------------------------------------------------


/home/runner/work/jupyter_releaser/jupyter_releaser/jupyter_releaser/util.py:174: UserWarning: Using deprecated setup.py invocation
  warnings.warn("Using deprecated setup.py invocation")
0.0.39
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.6/x64/bin/tbump", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/tbump/cli.py", line 245, in main
    run(args)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/tbump/cli.py", line 141, in run
    run_bump(arguments)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/tbump/cli.py", line 162, in run_bump
    bump(bump_options, arguments.operations)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/tbump/cli.py", line 172, in bump
    config_file = get_config_file(
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/tbump/config.py", line 222, in get_config_file
    res.get_config()
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/tbump/config.py", line 68, in get_config
    parsed = self.get_parsed()
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/tbump/config.py", line [103](https://github.com/davidbrochart/jupyter_releaser/runs/8310556740?check_suite_focus=true#step:4:106), in get_parsed
    return tool_section.value  # type: ignore
AttributeError: 'dict' object has no attribute 'value'. Did you mean: 'values'?

davidbrochart avatar Sep 12 '22 16:09 davidbrochart

I don't think this is related to the error from David above.

When trying to release JupyterLab, the draft PR got converted and populated with all to-be-published assets see draft release. But the publication failed because the target GitHub repository was not pass to the sub-action Publish of the Full release workflow: https://github.com/fcollonval/jupyter_releaser/runs/8308943651?check_suite_focus=true

fcollonval avatar Sep 12 '22 16:09 fcollonval

For now you can create a tag for https://github.com/jupyter-server/jupyter_releaser/commit/519b8dd8dd60b2e88c199f9a1dfba6a6c0ab2457 on your fork, and select that tag when running your workflows, you can get unblocked.

blink1073 avatar Sep 12 '22 18:09 blink1073

@davidbrochart I think the error you are seeing is from the multi-dependency handling.

blink1073 avatar Sep 12 '22 20:09 blink1073

I'm not sure, because there is the same issue in the "Check Release" action of this PR.

davidbrochart avatar Sep 13 '22 06:09 davidbrochart

@davidbrochart I'd recommend switching away from tbump in general. See https://github.com/jupyter-server/jupyter_releaser/pull/374 for an example of how to switch to hatchling version instead.

blink1073 avatar Sep 13 '22 19:09 blink1073

This PR now fails at check-python:

Checking dist/fps_login-0.0.41-py3-none-any.whl: PASSED
Checking dist/fps_kernels-0.0.41.tar.gz: PASSED
Checking dist/jupyverse-0.0.41.tar.gz: PASSED
ERROR: Could not find a version that satisfies the requirement fps-kernels==0.0.41 (from jupyverse) (from versions: 0.0.0, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.11, 0.0.12, 0.0.13, 0.0.15, 0.0.16, 0.0.17, 0.0.18, 0.0.19, 0.0.21, 0.0.22, 0.0.24, 0.0.25, 0.0.26, 0.0.27, 0.0.28, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.40)

Here jupyverse depends on the just-released fps-kernels==0.0.41, but it's not taken into account. Should I just skip check-python?

davidbrochart avatar Sep 16 '22 08:09 davidbrochart

Should I just skip check-python?

If I do so it fails at extract-release:

41898282+github-actions[bot]@users.noreply.github.com
Git checkout already exists
Already on 'main'
Your branch is up to date with 'origin/main'.
refs/heads/main
WARNING: jupyverse 0.0.41 does not provide the extra 'dev'
ERROR: Could not find a version that satisfies the requirement fps-contents==0.0.41 (from jupyverse[dev,test]) (from versions: 0.0.0, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.11, 0.0.12, 0.0.13, 0.0.15, 0.0.16, 0.0.17, 0.0.18, 0.0.19, 0.0.21, 0.0.22, 0.0.24, 0.0.25, 0.0.26, 0.0.27, 0.0.28, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.40)
ERROR: No matching distribution found for fps-contents==0.0.41

davidbrochart avatar Sep 16 '22 08:09 davidbrochart

@blink1073 this still fails. Any idea what can be done?

davidbrochart avatar Sep 22 '22 08:09 davidbrochart

You'd have to publish the packages to the local pypi server before calling check-python, and then make sure you are running the local pypi server during check-python, or skip check-python.

blink1073 avatar Sep 22 '22 15:09 blink1073

You'd have to publish the packages to the local pypi server before calling check-python, and then make sure you are running the local pypi server during check-python, or skip check-python.

The releaser has a utility function to start the local PyPI server:

https://github.com/jupyter-server/jupyter_releaser/blob/a4de95e0c6213ee9234edf3376c3b1849989cebc/jupyter_releaser/python.py#L183-L196

There doesn't seem to be a way to stop it though. So not sure if starting it before check-python would then cause issues when the publish-assets step tries to start it again.

jtpio avatar Sep 20 '23 06:09 jtpio