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?
done[0].
I shall wait 2 more days to let Ranjith (I don't think he is here) upload the new script. Else, I shall be doing that.
Thanks.
@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
@suhail have contacted me regarding this bug. Hope he shall fix this. :)
There are many bugs, I asked him about another bug :) Can you generate dependency list for livescript? This is going like a chain reaction :(
I can't reproduce the bug you sent to @suhail [0].
I get the right result. I'm on Debian Stretch with no packges from sid. Let me know how to contact you via IRC. Or else, contact me at freenode (nick: pksadiq)
[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840167
What is the output of apt-cache policy node-nomnom? node-nomnom was added to stretch only on 2016-08-03. Try again after you run apt-get update. I'm j4v4m4n on freenode.
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?
Done[0]. I shall try to upload the updated script soon. I have already updated the Template page.
[0] https://wiki.debian.org/Javascript/Nodejs/Tasks/Browserify
Please note that I'm running Debian testing (and not sid). So the dependency pasted in the wiki may not be up to date. Please inform me if you find any errors.
Thanks
If you need ssh access to a debian sid box, I can share our test machine.
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
Alignment needs manual fixing. Can you try to fix the script?
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?
ok. I will try
@renjiththankachan can you try packaging lcid?
@praveenarimbrathod can you share a test debian box ?
Sure. We maintain ssh keys in https://gitlab.com/debian-ruby/pxq.in (private repo). Share your gitlab.com id and I'll give you access to this repo. Then you can add your ssh key there. If anyone else want a test box, follow the same steps.
Though a local sid environment can easily be created from any GNU/Linux distro by this command lxc-create -n debian -t debian -- -r sid. Once created, use lxc-attach -n debian. Create a normal user with adduser <username> and use su - to switch. See https://linuxcontainers.org/lxc/getting-started/ for more.
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.
@praveenarimbrathod yeah, I am running from sid. I shall try is-arrayish.
@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 ?
Btw is-arrayish is a leaf package without any dependencies.
@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.
Just consider the case of source and binary package having different names.
For example,
source package: node-mocha, binary package: mocha
@suhail @sadiq found root cause for #836182. I was missing deb-src line in my apt sources. Can you try changing it to look for binary packages or show a message asking user to enable deb-src instead of 'None'?
@praveenarimbrathod Checking for binary packages seems more reasonable. A hacky solution would be to use apt-cache madison <module> node-<module> | grep Packages. I have created a patch (attached) for npm2deb. I unable to test it because of #840811 [1].
Could you please verify if this patch works.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840811
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
To setup aliases and environment variables for packaging, follow https://wiki.debian.org/Diaspora/Packaging/gem2deb#Setup_your_environment