Python Packaging at Kochi Python follow up
Follow up activities for the packaging workshop
Setup aliases and environment variables for packaging: https://wiki.debian.org/Diaspora/Packaging/gem2deb#Setup_your_environment
Steps for packaging Node.js modules: https://wiki.debian.org/Javascript/Nodejs/Npm2Deb
Some node modules available for packaging are listed below. Please reply with your selection.
is-fullwidth-code-point - @suhail
lcid - @renjiththankachan
Read https://www.debian.org/doc/manuals/maint-guide/ to get more clarity on debian packaging concepts.
Some node modules available for packaging are listed below. Please reply with your selection.
string-width
lcid
get-caller-file
is-arrayish
path-exists
strip-bom
pify
builtin-modules
hosted-git-info
spdx-expression-parse
spdx-license-ids
@sruthi So, we started with Python packaging and ended up with Node packaging, eh? Nice. :)
@balasankarchelamat Javascript is everywhere! Pagure needs it, gnukhata needs it, groupserver needs it, any python web app needs it. And thanks to excellent hack by @mohammedsadikpk , we have updated tasks page on debian wiki for all important node packages.
We are starting with yargs (dependency for updating uglifyjs) https://wiki.debian.org/Javascript/Nodejs/Tasks/yargs
All,
Steps for packaging Node.js modules is listed here https://wiki.debian.org/Javascript/Nodejs/Npm2Deb
And you can come to debian-in@conference.diasp.in chat group if you need any help.
Can u please give details of next event
@abhisheks you'll have to join Kochi Python mailing list, hope someone here can share the mailing list details.
@mohammedsadikpk can you generate dependency list for jison?
@sadiq can you try to fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840174 ? npm2deb is written in python and its source is available at https://anonscm.debian.org/cgit/pkg-javascript/npm2deb.git
I have contacted some folks and asked them to try fixing some bugs in npm2deb (its written in python). Please comment on the bugs if you have started working on any bugs.
Others please take one from http://bugs.debian.org/npm2deb and comment here before starting.
Already taken: #840167 (@suhail ) #840169 (Rahul Krishnan) # 840170 (@bobyaloysiusjohnso ) #840174 (@sadiq )
Available: #840213 #840207 #840226
Hi praveen ji,I am currently looking into the source code of npm2deb
https://github.com/LeoIannacone/npm2deb
to try and modify it to the pi to deb format as we had discussed that day.
If you can read Ruby code, please go through the source code of gem2deb also. From my experience, it automates more stuff than npm2deb.
It would be good to know the workflow gem2deb is following too.
@kvsreeram need a standard setup.py file i think :)
@sadiq Could you please update dependencies for browserify as well?
Ranjith did not get his wiki account activated. So, I have updated the dependency creation script[0] and the template page[1]. Anyone interested may now help update the dependency wiki pages.
How to run:
1. download the script[0]
2. Install tree and npm: sudo apt install tree npm
3. run ./js_task_create.py module -o out-page
replace 'module' with the 'module' you wish. Eg: grunt
4. The file generated is saved to out-page (you can give any name for output file). Copy the complete file content. Edit the wiki page of the module, and replace the complete text.
Please note that the previous Template was dumb and listed the build dependencies under dependencies. I have fixed the template page. Please update the wiki pages.
Thanks
[0] https://wiki.debian.org/Javascript/Nodejs/Tasks?action=AttachFile&do=view&target=js_task_create.py
[1] https://wiki.debian.org/Javascript/Nodejs/Tasks/Template
Is debian stretch or sid mandatory ?
Is jessie too old to get started ?
@shanavasm some tools (like npm2deb, dh-make, licensecheck) will be missing some features, but it is enough to get the concept. If you are willing to search and find workarounds for those issues go ahead. But I suggest you create an lxc container or virtual machine of sid inside jessie for packaging.
@suhail since we are not able to reproduce the bug you were working on, we can drop it for now. Can you try packaging string-width?
@renjiththankachan can you try packaging lcid?
lxc done the job !
Have created a task page for lcid [1]. Debian package details of invert-kv (dependency of lcid) node-invert-kv (1.0.0-1) is missing from the generated output.
Is is need to be added manually or am I miss something ?
@shanavasm you need a task page only if the dependency list is big. Are you running the script from sid?
We can create the dependency tree locally with npm2deb like npm2deb depends -b -r lcid. If there is more than 10 unpackaged dependencies then only we need to create a task page.
@shanavasm can you try is-arrayish?
@kvsreeram I think it would be better to package one lib before you try pypi2deb so you get a better idea of what you want to achive. Can you try packaging path-exists?
Will do from next week on praveenji
@praveenarimbrathod It seems there is a bug in js_task_create.py script. It gets the debian package details from the output of apt-cache madison <package> | grep Source (line no:46). But the Sources entry is included in the output only if there is a deb-src entry in sources.list. So the command should be apt-cache madison <package> | grep Packages. WDYT ?
@shanavasm Haven't gone through code, but will rmadison solve the issue?
@balasankarchelamat rmadison lists details of package for all dists like stable, testing etc... . That makes parsing more complex.
@shanavasm So, you need info about a single distribution. You can use -s flag.
Am on mobile data, so can't look at the code now. What's it you are trying to achieve using the result? To check which version is available on sid?
@balasankarchelamat Yeah, it checks the corresponding debian package for node module.
apt-cache madison <package> | grep Packages fixes the issue. Just want to make sure it doesn't break anything else, so that the script in wiki can be updated.
Have updated js_task_create.py too.
@praveen, I will try is-arrayish
@shanavasm use like 'rmadison -s sid node-jison'. You can test it with other packages which don't have utf-8 in description like jison. Submit the patch directly on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836182 and may be send a pull request to upstream github repo.
@praveenarimbrathod I have generated package and source files for is-arrayish as described in [1]. Files are at gitlab [2]. What next ?.
Shall I send an ITP ?
[1] https://wiki.debian.org/Javascript/Nodejs/Npm2Deb
[2] https://gitlab.com/shanavasm/debian-packaging/tree/master/is-arrayish
@shanavasm You should use gbp import-dsc command to import the package as a git repo. See https://wiki.debian.org/Diaspora/Packaging/gitlab#gbp_import-dsc
Unlike gem2deb, you'll have to download orig.tar.gz, run uupdate, and dpkg-source -b . to get the dsc file.
Go ahead with the ITP.
@sadiq I had to run these command in vim to clean the outfile.
1,$g/^node.*$/d
1,$g/^und.*$/d
1,$g/^colo.*$/d
1,$s/)$/) || || ||/
Can you check for packages in NEW and which has ITP bugs? npm2deb search does these already so you can refer its code.
@praveenarimbrathod I have created ITPs for is-arrayish [1] and strip-bom[2]. Repos are at https://gitlab.com/shanavasm/node-is-arrayish and https://gitlab.com/shanavasm/node-strip-bom
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841158
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841391
@praveenarimbrathod Thanks, Done :)
@shanavasm Congratulations! Both packages are uploaded to debian! Now it will be reviewed by ftp masters before it is added to debian. They may ask you to change something, usually if you missed any copyright notices.
Also your request to join pkg-javascript on alioth is accepted. So next time, push your packages to alioth. See https://wiki.debian.org/Alioth/SSH for using ssh with alioth.
To create a new git repo you can follow these steps:
ssh git.debian.org
cd /git/pkg-javascript
./setup-repository node-is-arrayish 'Packaging for node-is-arrayish'
You can try is-equal-shallow next. You can take any leaf module from https://wiki.debian.org/Javascript/Nodejs/Tasks/grunt but just let me know before you start working so we don't duplicate work.
@praveenarimbrathod Thanks :):) !!.
I'll try is-equal-shallow next
@praveenarimbrathod
npm2deb create is-equal-shallow throws the following error
Warnings occured:
[error] is-primitive: dependency node-is-primitive not in debian
How to handle dependencies not added to debian ?
@praveenarimbrathod - same doubt as mentioned above
$ npm2deb create string-width
Warnings occured:
[error] is-fullwidth-code-point: dependency node-is-fullwidth-code-point not in debian
[error] strip-ansi: dependency node-strip-ansi not in debian
$ npm2deb depends -b -r string-width
Dependencies:
NPM
string-width (2.0.0)
├─ is-fullwidth-code-point (2.0.0)
└─ strip-ansi (3.0.0)
└─ ansi-regex (2.0.0)
Congratulations @suhail . Your package node-defaults is uploaded to debian.
@sadiq @shanavasm @suhail @balasankarchelamat @bhe shall we do another packaging session in Kochi?
To setup aliases and environment variables for packaging, follow https://wiki.debian.org/Diaspora/Packaging/gem2deb#Setup_your_environment