Skip to content

WIP: Python3: update makefiles to test in Python 3 in allow-failures mode#211

Closed
cjmayo wants to merge 1 commit intolinkchecker:masterfrom
cjmayo:python3_01
Closed

WIP: Python3: update makefiles to test in Python 3 in allow-failures mode#211
cjmayo wants to merge 1 commit intolinkchecker:masterfrom
cjmayo:python3_01

Conversation

@cjmayo
Copy link
Copy Markdown
Contributor

@cjmayo cjmayo commented Apr 10, 2019

No description provided.

@cjmayo cjmayo mentioned this pull request Apr 10, 2019
LEX = flex
YACC = bison
PYINCLUDE=-I/usr/include/python2.7
PYINCLUDE=-I/usr/include/python
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW my machine (Ubuntu 18.10) does not have a /usr/include/python. It has /usr/include/python2.7 and /usr/include/python3.* for various values of *.

I wonder if we should maybe use something like $(pkg-config --cflags python) (which on my machine prints -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7)?

(Or we could merge that PR that replaces linkcheck/HtmlParser with BeautifulSoup.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have /usr/include/python either, and nor does pkg-config --cflags python work. Supporting both Python 2 and 3 is complicated, and varies between distrubutions...

On the other hand, what does this file need to do? Supply a clean instruction? Run the awk?
Because setup.py does seem to do the actual building using Extension - which is the bit that needs the include.

@cjmayo
Copy link
Copy Markdown
Contributor Author

cjmayo commented Apr 16, 2019

Suggest closing this one without merging. Project is building fine from setup.py without these changes and there is at least one other Makefile problem. Needs someone who has a use for the Makefiles to investigate.

@anarcat anarcat changed the title {python3_01} Python3: update makefiles to test in Python 3 in allow-failures mode WIP: {python3_01} Python3: update makefiles to test in Python 3 in allow-failures mode Apr 16, 2019
@anarcat
Copy link
Copy Markdown
Contributor

anarcat commented Apr 16, 2019

i'd like to get rid of the Makefile altogether, if it's not useful. this can (and should) all be replaced by setup.py stuff, IMHO. yet this probably doesn't block py3 porting, so keeping this open until someone deals with the Makefile (or opens a more targeted issue to do so).

@cjmayo cjmayo changed the title WIP: {python3_01} Python3: update makefiles to test in Python 3 in allow-failures mode WIP: Python3: update makefiles to test in Python 3 in allow-failures mode Apr 17, 2019
@cjmayo
Copy link
Copy Markdown
Contributor Author

cjmayo commented Apr 17, 2019

This one also for the record:

../linkchecker /usr/lib/python2.7/argparse.py

Called by top-level make locale.

@mgedmin
Copy link
Copy Markdown
Contributor

mgedmin commented May 10, 2019

Suggest closing this one without merging. Project is building fine from setup.py without these changes and there is at least one other Makefile problem. Needs someone who has a use for the Makefiles to investigate.

I like Makefiles, but I don't have the energy to investigate this. +1 for closing (or even removing the Makefile entirely).

(IMHO in a Python project Makefiles are primarily a tool for maintainers. They make sense when the maintainer finds them useful. I find them useful: all of my personal Python projects have a Makefile that lets me do things like make test and make release without having to remember what particular tools or additional steps this one project has.)

@anarcat
Copy link
Copy Markdown
Contributor

anarcat commented May 10, 2019

+1 for closing (or even removing the Makefile entirely).

Yep, done.

(IMHO in a Python project Makefiles are primarily a tool for maintainers. They make sense when the maintainer finds them useful. I find them useful: all of my personal Python projects have a Makefile that lets me do things like make test and make release without having to remember what particular tools or additional steps this one project has.)

While I understand where this is coming from, adding Make as a dependency to a project, even if only for maintenance, adds yet another hurdle to adoption for new people. They need to learn another tool that's not part of the standard programming environment. Python (and especially distutils and friends) is complicated enough without having people figure out Make on top of that...

I would actually agree if Makefiles were used as tiny wrappers on top of setup.py to remind people of the right targets to use. But looking at our own Makefile, it's not really the case: it's 200 lines of business logic, doing everything from a range of linting, unit tests, debian package build (!), homepage generation. It's a mess! And that's often what happens in those cases: the Makefile is there and then it's easy to expand it to do all sorts of random things and it grows and grows until it supplants setup.py for even stuff that it's supposed to be doing (like setup.py test).

This is arguably because packaging is too hard in Python. But that's being improved and we should follow that instead of hiding it under a layer of Makefile-ing.

So while I also do like Makefiles and use them often, I think that, in our case, we should totally get rid of it and do everything in setup.py, like good Python citizens. ;)

But until we go there, i think this can be closed as well. :)

@anarcat anarcat closed this May 10, 2019
@cjmayo cjmayo deleted the python3_01 branch November 21, 2019 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants