ebuild for markdown2 python module
Created attachment 286093 [details] markdown2-1.0.1.19.ebuild
> SUPPORT_PYTHON_ABIS="" > RESTRICT_PYTHON_ABIS="" What is this supposed to mean? > inherit distutils I've been taught to explicitly include python.eclass :) > SRC_URI="http://pypi.python.org/packages/source/m/markdown2/${P}.zip" Use "mirror://pypi". > KEYWORDS="~x86 ~amd64" Sort alphabetically. > DEPEND=">=virtual/python-2.4" No way. Use PYTHON_DEPEND. Take a look at http://www.gentoo.org/proj/en/Python/developersguide.xml.
Thanks for pointing out my bad habits. :-) Please checkout the new uploaded ebuild. (In reply to comment #2) > > SUPPORT_PYTHON_ABIS="" > > RESTRICT_PYTHON_ABIS="" > What is this supposed to mean? > > > inherit distutils > I've been taught to explicitly include python.eclass :) > > > SRC_URI="http://pypi.python.org/packages/source/m/markdown2/${P}.zip" > Use "mirror://pypi". > > > KEYWORDS="~x86 ~amd64" > Sort alphabetically. > > > DEPEND=">=virtual/python-2.4" > No way. Use PYTHON_DEPEND. > > Take a look at http://www.gentoo.org/proj/en/Python/developersguide.xml.
Created attachment 286337 [details] markdown2-1.0.1.19-r1
(In reply to comment #4) > Created attachment 286337 [details] > markdown2-1.0.1.19-r1 Seems ok. Does it pass repoman testing? Does the package have test suite?
(In reply to comment #5) > (In reply to comment #4) > > Created attachment 286337 [details] > > markdown2-1.0.1.19-r1 > > Seems ok. Does it pass repoman testing? Does the package have test suite? Yes, but after I added the test suite, it keep telling me: >>> Test phase [not enabled] Even though I added FEATURES="maketest". How can I fix this? Also, I did not look closely into the emerge info generated by the new ebuild. Seems that it does not emerge properly. :-( Here is what I get: >>> Installing (1 of 1) dev-python/markdown2-1.0.1.19-r1 * checking 0 files for package collisions >>> Merging dev-python/markdown2-1.0.1.19-r1 to / >>> Safely unmerging already-installed instance... No package files given... Grabbing a set. <<< obj /usr/lib64/python2.7/site-packages/markdown2.py <<< obj /usr/lib64/python2.7/site-packages/markdown2-1.0.1.19-py2.7.egg-info <<< obj /usr/bin/markdown2 --- !empty dir /usr/lib64/python2.7/site-packages --- !empty dir /usr/lib64/python2.7 --- !empty dir /usr/lib64 --- !empty dir /usr/bin --- !empty dir /usr >>> Regenerating /etc/ld.so.cache... >>> Original instance of package unmerged safely. >>> dev-python/markdown2-1.0.1.19-r1 merged. >>> Auto-cleaning packages... I must have used python.eclass wrong. I've checkout other ebuilds using python eclass but all the ebuild I found uses stuff like emake install. Could you give me some hints on using python eclass with setuptools?
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > Created attachment 286337 [details] > > > markdown2-1.0.1.19-r1 > > > > Seems ok. Does it pass repoman testing? Does the package have test suite? > > Yes, but after I added the test suite, it keep telling me: > > >>> Test phase [not enabled] > > Even though I added FEATURES="maketest". How can I fix this? > It is FEATURES="test", not "maketest". Paste ebuild with testsuite enabled please. > > I must have used python.eclass wrong. I've checkout other ebuilds using python > eclass but all the ebuild I found uses stuff like emake install. Could you give > me some hints on using python eclass with setuptools? I don't see anything bad in that log. setuptools are compatible with distutils, so distutils_src_install() handles that, just ensure it's called in src_install phase.
Created attachment 286349 [details] markdown2-1.0.1.19-r2.ebuild
Created attachment 286351 [details] metadata.xml
Thank you for all the instructions you gave to me. :-) New ebuild uploaded, it passed the repoman testing on my PC. (In reply to comment #7) > It is FEATURES="test", not "maketest". Paste ebuild with testsuite enabled > please. > > > > > I must have used python.eclass wrong. I've checkout other ebuilds using python > > eclass but all the ebuild I found uses stuff like emake install. Could you give > > me some hints on using python eclass with setuptools? > > I don't see anything bad in that log. setuptools are compatible with distutils, > so distutils_src_install() handles that, just ensure it's called in src_install > phase.
(In reply to comment #10) > Thank you for all the instructions you gave to me. :-) > > New ebuild uploaded, it passed the repoman testing on my PC. Seems nice. Try setting DISTUTILS_SRC_TEST="setup.py" and removing src_test().
(In reply to comment #2) > > inherit distutils > I've been taught to explicitly include python.eclass :) Please don't explicitly inherit python.eclass when distutils.eclass is inherited.
(In reply to comment #12) > (In reply to comment #2) > > > inherit distutils > > I've been taught to explicitly include python.eclass :) > > Please don't explicitly inherit python.eclass when distutils.eclass is > inherited. I remember that in the very begging of my way someone, probably Tommy[D], said to me: always inherit all directly used eclasses, including python. I appologize for not being aware with modern rules in Gentoo Python project.
(In reply to comment #11) > Seems nice. Try setting DISTUTILS_SRC_TEST="setup.py" and removing src_test(). After set DISTUTILS_SRC_TEST="setup.py" and removed src_test(), I get following error when emerge with test FEATURES: >>> Source compiled. PYTHONPATH=build/lib python2.7 setup.py test usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'test' * ERROR: dev-python/markdown2-1.0.1.19-r3 failed (test phase): * Testing failed * * Call stack: * ebuild.sh, line 56: Called src_test * environment, line 3702: Called distutils_src_test * environment, line 1147: Called die * The specific snippet of code: * PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"; Following is the ebuild I that modified: EAPI=3 PYTHON_DEPEND="2:2.4" DISTUTILS_SRC_TEST="setup.py" inherit distutils DESCRIPTION="Python Markdown language reimplementation" SRC_URI="mirror://pypi/m/markdown2/${P}.zip" HOMEPAGE="https://github.com/trentm/python-markdown2" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" DEPEND="" RDEPEND="${DEPEND}"
Ah, i'm sorry, i guided you wrong. Previous ebuild, with src_test(), was good.
(In reply to comment #15) > Ah, i'm sorry, i guided you wrong. Previous ebuild, with src_test(), was good. Ok, finally, it's done. That's a long story. :-)
(In reply to comment #16) > (In reply to comment #15) > > Ah, i'm sorry, i guided you wrong. Previous ebuild, with src_test(), was good. > > Ok, finally, it's done. That's a long story. :-) Yeah. So now you want it to be in tree. Can you tell why it's better than original markdown?
Once more technical comment: I suggest setting the following variables to enable support for multiple python ABIs. SUPPORT_PYTHON_ABIS=1 RESTRICT_PYTHON_ABIS="3.*"
(In reply to comment #18) > Once more technical comment: I suggest setting the following variables to > enable support for multiple python ABIs. > > SUPPORT_PYTHON_ABIS=1 You're right, i missed them not being set. > RESTRICT_PYTHON_ABIS="3.*" Why you are sure it won't work on py3?
(In reply to comment #19) > > RESTRICT_PYTHON_ABIS="3.*" > Why you are sure it won't work on py3? I just tested it, the src_compile throws an error. * Building of dev-python/markdown2-1.0.1.19-r2 with CPython 3.1... python3.1 setup.py build -b build-3.1 Traceback (most recent call last): File "setup.py", line 11, in <module> import markdown2 File "/var/tmp/portage/dev-python/markdown2-1.0.1.19-r2/work/markdown2-1.0.1.19/lib/markdown2.py", line 575 except ValueError, ex: Also, src_test must be changed for multi-abi support. src_test() { cd test || die testing() { PYTHONPATH="build-${PYTHON_ABI}/lib" "$(PYTHON)" test.py } python_execute_function testing }
(In reply to comment #20) > (In reply to comment #19) > > > RESTRICT_PYTHON_ABIS="3.*" > > Why you are sure it won't work on py3? > > I just tested it, the src_compile throws an error. > > * Building of dev-python/markdown2-1.0.1.19-r2 with CPython 3.1... > python3.1 setup.py build -b build-3.1 > Traceback (most recent call last): > File "setup.py", line 11, in <module> > import markdown2 > File > "/var/tmp/portage/dev-python/markdown2-1.0.1.19-r2/work/markdown2-1.0.1.19/lib/markdown2.py", > line 575 > except ValueError, ex: That is silly, should be reported upstream. Though it can drop 2.4 compability. > Also, src_test must be changed for multi-abi support. > > src_test() { > cd test || die > testing() { > PYTHONPATH="build-${PYTHON_ABI}/lib" "$(PYTHON)" test.py > } > python_execute_function testing > } Yes, it's right.
(In reply to comment #18) > Once more technical comment: I suggest setting the following variables to > enable support for multiple python ABIs. > > SUPPORT_PYTHON_ABIS=1 > RESTRICT_PYTHON_ABIS="3.*" So, what's the difference between: SUPPORT_PYTHON_ABIS=1 RESTRICT_PYTHON_ABIS="3.*" and PYTHON_DEPEND="2:2.4" You mean that we should always use SUPPORT_PYTHON_ABIS=1 ?
(In reply to comment #19) > (In reply to comment #18) > > Once more technical comment: I suggest setting the following variables to > > enable support for multiple python ABIs. > > > > SUPPORT_PYTHON_ABIS=1 > You're right, i missed them not being set. > > > RESTRICT_PYTHON_ABIS="3.*" > Why you are sure it won't work on py3? There is a request for py3 support in the issue page, though not handled yet.
(In reply to comment #22) PYTHON_DEPEND controls the contents of DEPEND and RDEPEND variables. RESTRICT_PYTHON_ABIS controls which python slots the ebuild will target if SUPPORT_PYTHON_ABIS is set. PYTHON_DEPEND and RESTRICT_PYTHON_ABIS should ideally be linked in some way, but this link has not yet been implemented in the main portage tree.
Created attachment 286511 [details] markdown2-1.0.1.19-r3.ebuild
(In reply to comment #24) > (In reply to comment #22) > > PYTHON_DEPEND controls the contents of DEPEND and RDEPEND variables. > > RESTRICT_PYTHON_ABIS controls which python slots the ebuild will target if > SUPPORT_PYTHON_ABIS is set. > > PYTHON_DEPEND and RESTRICT_PYTHON_ABIS should ideally be linked in some way, > but this link has not yet been implemented in the main portage tree. I see, thanks Mike. :-) New ebuild have been loaded.
(In reply to comment #17) > (In reply to comment #16) > > (In reply to comment #15) > > > Ah, i'm sorry, i guided you wrong. Previous ebuild, with src_test(), was good. > > > > Ok, finally, it's done. That's a long story. :-) > > Yeah. So now you want it to be in tree. Can you tell why it's better than > original markdown? As for the reason, I may say it just works for me. ;-P I have a little script that generate static content for me with the help of markdown2. The api seems to be simpler than the original markdown. And its claimed to be faster on its homepage, though I do not have time to test it.
Ok, i added it to tree with pygments dependency. Happy using :)