Page MenuHomeSoftware Heritage

Move SWHID classes and functions from identifiers.py to swhids.py
ClosedPublic

Authored by vlorentz on Sep 22 2021, 5:47 PM.

Details

Summary

identifiers.py initially worked only on bare sha1_git.

I chose to add the SWHID classes in that module because
of the name, but the SWHID code didn't actually interact
with the other functions in the module, so it now feels
out of place to me.

(D6326 removes other functions)

Diff Detail

Repository
rDMOD Data model
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6323 (id=22977)

Rebasing onto b6f5e30b53...

Current branch diff-target is up to date.
Changes applied before test
commit d08b45c8766ec82ef9b47c30e2d574e279a0e37e
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 16:36:30 2021 +0200

    Move SWHID classes and functions from identifiers.py to swhids.py
    
    identifiers.py initially worked only on bare sha1_git.
    
    I chose to add the SWHID classes in that module because
    of the name, but the SWHID code didn't actually interact
    with the other functions in the module, so it now feels
    out of place to me.

See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/372/ for more details.

olasd added inline comments.
swh/model/identifiers.py
15–16

Could we somehow wrap use of these imports in a DeprecationWarning? This feels like something that we'll end up keeping forever if we don't weed them out explicitly.

swh/model/identifiers.py
15–16

I'll deprecate any import of identifiers.py if you're fine with D6326

I'd suggest letting this one stew for a bit for others to have a chance to object :-)

swh/model/identifiers.py
15–16

Ah, even better.

This revision is now accepted and ready to land.Sep 22 2021, 6:18 PM
This revision was landed with ongoing or failed builds.Sep 23 2021, 7:55 PM
This revision was automatically updated to reflect the committed changes.

Build is green

Patch application report for D6323 (id=23018)

Rebasing onto 0dd33cdf7d...

Current branch diff-target is up to date.
Changes applied before test
commit 9ec683264c415731286005dff823e1099ef358c3
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 16:36:30 2021 +0200

    Move SWHID classes and functions from identifiers.py to swhids.py
    
    identifiers.py initially worked only on bare sha1_git.
    
    I chose to add the SWHID classes in that module because
    of the name, but the SWHID code didn't actually interact
    with the other functions in the module, so it now feels
    out of place to me.

See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/384/ for more details.