COllaborative DEcision MAking (codema.in)

Python Packaging at Kochi Python follow up

Pirate Praveen PublicSeen by 453

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

[deactivated account]

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

Balasankar C

@sruthi So, we started with Python packaging and ended up with Node packaging, eh? Nice. :)

[deactivated account]

@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.

Abhishek S

Can u please give details of next event

Pirate Praveen

@abhisheks you'll have to join Kochi Python mailing list, hope someone here can share the mailing list details.

Pirate Praveen

@mohammedsadikpk can you generate dependency list for jison?

Pirate Praveen

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

Balasankar C

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.

Renjith Thankachan

@kvsreeram need a standard setup.py file i think :)

[deactivated account]

@sadiq Could you please update dependencies for browserify as well?

Mohammed Sadiq

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

Shanavas M

Is debian stretch or sid mandatory ?
Is jessie too old to get started ?

Pirate Praveen

@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.

Pirate Praveen

@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?

Pirate Praveen

@renjiththankachan can you try packaging lcid?

Shanavas M

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 ?

Pirate Praveen

@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.

Pirate Praveen

@shanavasm can you try is-arrayish?

Pirate Praveen

@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?

K V Sreeram

Will do from next week on praveenji

Shanavas M

@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 ?

Balasankar C

@shanavasm Haven't gone through code, but will rmadison solve the issue?

Shanavas M

@balasankarchelamat rmadison lists details of package for all dists like stable, testing etc... . That makes parsing more complex.

Balasankar C

@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?

Shanavas M

@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.

Shanavas M

Have updated js_task_create.py too.

@praveen, I will try is-arrayish

Pirate Praveen

@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.

Shanavas M

@praveenarimbrathod Thanks, Done :)

Pirate Praveen

@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.

Shanavas M

@praveenarimbrathod Thanks :):) !!.

I'll try is-equal-shallow next

Shanavas M

@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 ?

Suhail

@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)

Pirate Praveen

Congratulations @suhail . Your package node-defaults is uploaded to debian.

Pirate Praveen

@sadiq @shanavasm @suhail @balasankarchelamat @bhe shall we do another packaging session in Kochi?