[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How does one package a multirepo project?



Hi,

Le lundi 19 octobre 2020 à 12:15 +0200, Jonas Smedegaard a écrit :
> Quoting Pirate Praveen (2020-10-19 12:01:47)
> > On 2020, ഒക്‌ടോബർ 19 12:45:28 PM IST, Julien Puydt 
> > <julien.puydt@gmail.com> wrote:
> > > I was trying to update the ipywidgets package. It once had a
> > > quite 
> > > normal upstream, but then things went wild, if not stellar :
> > > they 
> > > went monorepo.
> > ...
> > > So basically my question is the one in the mail subject : how
> > > does 
> > > one package a multirepo project?
> > > 
> > 
> > Look at node-rollup-plugin-* packages. The source packages will
> > have a 
> > lot of duplication. I think uscan should provide an option to
> > include 
> > only specific directories when repacking to make handling
> > monorepos 
> > easier.
> 
> To strip upstream content completely from Debian redistribution, use 
> Files-Excluded-foo: in topmost section of debian/copyright - see 
> jsbundle-web-interfaces for an example of that.
> 
> To strip upstream content from entering the Debian git while still 
> getting redistributed - notably to avoid upstream git hints from
> messing 
> with a different use of git in Debian - use git-buildpackage and its 
> --filter option.  Again, jsbundle-web-interfaces is an example of
> that.

If I try to use the following script to update my d/copyright and
create a d/watch (I haven't any yet).

project = 'lumino'
github = f'https://github.com/jupyterlab/{project}'
packages = ['algorithm', 'application', 'collections', 'commands',
            'coreutils', 'datagrid', 'datastore', 'default-theme',
            'disposable', 'domutils', 'dragdrop', 'keyboard',
            'messaging', 'polling', 'properties', 'signaling',
            'virtualdom', 'widgets']

# In the real world, the following list of names is the result of:
#
# from os import listdir
# names = listdir('.')
#
# FIXME: since I don't have a main, where do I get CHANGELOG.md,
LICENSE.md and README.md from?
# WORKAROUND: edit by hand one of the components to let it get those
files!
#
names = ['api-extractor-base.json', 'CHANGELOG.md', 'CONTRIBUTING.md',
'examples',
         'lerna.json', 'LICENSE', 'notebooks', 'package.json',
'packages',
         'README.md', 'RELEASE.md', 'review' 'yarn.lock']

print('============================\n       d/copyright\n==============
==============\n')
for package in packages:
    chunks = []
    for name in names:
        if name != 'packages' and name != 'debian':
            chunks.append(name)
    for other in packages:
        if other != package:
            chunks.append(f'packages/{other}')
    print(f'Files-Excluded-{package}: ' + ' '.join(chunks)+'\n')

print('============================\n     d/watch\n====================
========\n')
chunks = []
for package in packages:
    chunk = 'opts=\\\n'
    chunk = chunk + f'component={package},\\\n'
    chunk = chunk +
'dversionmangle=auto,repacksuffix=+ds,compression=gzip,\\\n'
    # FIXME: what if there are so many tags we don't see the relevant
one?
    chunk = chunk +
f'filenamemangle=s/.*@(@ANY_VERSION@@ARCHIVE_EXT)/{project}-{package}-
$1/ \\\n'
    chunk = chunk + f'{github}/tags \\\n'
    chunk = chunk + f'.*/{package}@@ANY_VERSION@@ARCHIVE_EXT@ group\n'
    chunks.append(chunk)
print('\n'.join(chunks))

It looks like uscan doesn't see the tag for the "algorithm" component,
as it isn't on the first page. And it looks like it doesn't try to look
for the other components. I tried to put "application" first, and now
it sees there's a newer package available, but I haven't found how to
get it to download. And of course after seeing there's a new
"application", it doesn't see "algorithm" and stops here.

Am I getting somewhere with today's tools? Can someone propose a nicer
way in the future?

Cheers,

JP



Reply to: