Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 support #458

Open
hjwp opened this issue Oct 24, 2014 · 32 comments
Open

Python 3 support #458

hjwp opened this issue Oct 24, 2014 · 32 comments

Comments

@hjwp
Copy link

hjwp commented Oct 24, 2014

Apologies if this is being tracked elsewhere, I did have a look.

First hurdle: currently requirements.txt won't install under python 3. The pinned version of coverage and markment seem to be the cause. Unpinning coverage gets you further, but markment seems to require an old version of Flask which won't work under Py3.

Downloading/unpacking flask==0.9 (from markment->-r requirements.txt (line 17))
  Using download cache from /home/harry/.pip-download-cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FF%2FFlask%2FFlask-0.9.tar.gz
  Running setup.py (path:/home/harry/.virtualenvs/lettuce/build/flask/setup.py) egg_info for package flask
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/harry/.virtualenvs/lettuce/build/flask/setup.py", line 62
        print "Audit requires PyFlakes installed in your system."
                                                                ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/home/harry/.virtualenvs/lettuce/build/flask/setup.py", line 62

    print "Audit requires PyFlakes installed in your system."

                                                            ^

SyntaxError: invalid syntax
@geokala
Copy link

geokala commented Mar 25, 2015

I'm also interested in python3 support. I'd open another issue but I couldn't title it better, so:
Do any of the maintainers have any input on this? Is there any development already in progress for python3 support or is this a case of "try it and start submitting pull requests"?

If the latter, how would tests best work for this particular compatibility feature? Running them in multiple versions of python by hand is of course an option but it doesn't seem to fit the spirit of a project about testing.

@KarstenSchulz
Copy link

+1 for Py3 support

@danni
Copy link
Collaborator

danni commented Aug 18, 2015

So I don't think Python 3 is going to happen in Lettuce unless someone takes it over. I had been doing it, but I've now moved all of my energy across to Aloe, which is a fork of Lettuce/new-parser that runs as a Nose plugin.

@nikolas
Copy link
Contributor

nikolas commented Dec 11, 2015

I'll try and come up with a pull request for python 3

@nikolas
Copy link
Contributor

nikolas commented Dec 11, 2015

lettuce relies on markment, which uses Flask 0.9, which isn't compatible with Python 3. There's a pull request to address this here: gabrielfalcao/markment#4

nikolas added a commit to nikolas/lettuce that referenced this issue Dec 11, 2015
@nikolas
Copy link
Contributor

nikolas commented Dec 11, 2015

A big chunk of work here will be converting everything in lettuce's tests directory to be compatible with python3's improved unicode support while maintaining compatibility with python 2. We can use six for this.

@rg3915
Copy link

rg3915 commented Dec 17, 2015

Lettuce support Python 3 is done?

@nikolas
Copy link
Contributor

nikolas commented Dec 17, 2015

No, I have a branch I was working on, but it's a work in progress.

@fkromer
Copy link

fkromer commented Jan 13, 2016

@nikolas: may one contribute to your lettuce fork?

@nikolas
Copy link
Contributor

nikolas commented Jan 13, 2016

@fkromer here's the branch I'm referring to if you're interested in continuing this work: https://github.com/nikolas/lettuce/tree/python3

Like @danni said, unless you want to take over the entire lettuce project, your effort might be better spent using aloe instead, which is an actively-maintained fork of lettuce.

@fkromer
Copy link

fkromer commented Jan 13, 2016

@nikolas i am not very experienced at porting from 2.x to 3.x but i would give it a try and contribute. I had a look at six and wondered that it is not using the module 2to3 from the standard library?

Unfortunately i am not able to take over the lettuce project. Aloe is interesting but as a wrapper of the nose package ("configured to only run Gherkin tests") which migrates the package lettuce but has "incompatible changes" in comparison to gabrielfalcao/lettuce it violates my taste of design somehow. I prefer package design in a "micro service/extension based package integration" overall context. So i would be interested in contributing to migrate the lettuce related parts from aloe back to lettuce and evolve aloe to a lettuce-plugin for nose :)

@nikolas
Copy link
Contributor

nikolas commented Jan 13, 2016

Yeah, both six and future can be useful when writing code compatible for python 2 and 3.

Here's a good cheat sheet: http://python-future.org/compatible_idioms.html

@AlexzAK
Copy link

AlexzAK commented Mar 10, 2016

Why pull request with python 3 patch isn't merged?
Do you have python 3 support in plans?

@raeisi
Copy link

raeisi commented Jan 3, 2017

Is there any chance to get this Python 3 Support up and running faster?

If not does anyone know of any other BDD TDD Cucamber like environment for Python3?

@geokala
Copy link

geokala commented Jan 3, 2017

behave works reasonably well in my experience. Some irritations but that's always the way when coming to a new framework.

@danni
Copy link
Collaborator

danni commented Jan 3, 2017 via email

@Naereen
Copy link

Naereen commented Jun 10, 2018

Hi all,
This was never finished?
It's too bad, Python 2 is really dead now, and lettuce sound(s/ed) exciting!

@sgpy
Copy link

sgpy commented Feb 3, 2019

Umm... still an open item. Let me take a stab, and see if it gets anywhere.

@sgpy
Copy link

sgpy commented Feb 3, 2019

@nikolas Did you get a chance to complete the migration? So far i have encountered some minor problem with mox(glasser/pymox#65 (comment)).

@sgpy
Copy link

sgpy commented Feb 10, 2019

@gabrielfalcao @Naereen @raeisi @AlexzAK @fkromer @nikolas @rg3915 @hjwp @geokala

Hello folks - lettuce fork ready for beta testing which supports py27 & py37 (refer CHANGELOGS.md for changes). I do plan to merge it once i get some feedback for you all.

Testing

PY2

All passing

PY3

UNIT - All Passing
FUNCTIONAL - Four test cases which needs to retrospectively fix due to changes in source code line numbers & subtle unicode values hardcoded in the test cases

changes

@sgpy
Copy link

sgpy commented Feb 12, 2019

@gabrielfalcao @nikolas Any feedback? Wanted to send in a merge request.

@nikolas
Copy link
Contributor

nikolas commented Feb 12, 2019

@sgpy I mean.. that looks great. I would love to merge a pull request like this. But the first step toward getting that merged isn't opening it in this repo... rather, moving this repo to a new organization that people other than @gabrielfalcao actually have admin access to, as he seems to have moved on.

If you want to make progress here, try and get lettuce into https://jazzband.co/.

@sgpy
Copy link

sgpy commented Feb 12, 2019

@nikolas agree & i think that is the right way forward. Do you have a lead which i can track at Jazzband?

@chris-piekarski
Copy link

chris-piekarski commented Feb 13, 2019

Your python3 fork works good for me @sgpy; thanks!

@sgpy
Copy link

sgpy commented Feb 14, 2019

@chris-piekarski great to hear that. Cheers....

@nikolas
Copy link
Contributor

nikolas commented Feb 14, 2019

@sgpy I would enable GitHub issues on your fork of this library, so issues specific to the new code can be tracked there rather than here. You can do that in the repository's settings.

@nikolas
Copy link
Contributor

nikolas commented Feb 14, 2019

@sgpy the process for transferring a project to jazzband is outlined here: https://jazzband.co/about/guidelines

I'm not sure how exactly you do the transfer, but I would join their IRC room and ask around there: https://jazzband.co/about/contact

@danni
Copy link
Collaborator

danni commented Feb 14, 2019

Lettuce users are encouraged to take a look at Aloe, which grew out of an attempt to port Lettuce to Python 3 and fix up the bugs in the parser.

@sgpy
Copy link

sgpy commented Feb 15, 2019

@nikolas Awesome. Meanwhile i will try and close open issues (as much as possible) on the main line. Let me know how things progress with JazzBand.

@danni Aloe is the most logical step forward for lettuce users. However, i feel confident migrating my codebase to py37, and then moving to Aloe. Happy to contribute towards Aloe codebase too (if required).

@fdcds
Copy link

fdcds commented Jun 29, 2020

There was a PR for Python 3 support back in the day: #324

@nikolas
Copy link
Contributor

nikolas commented Jun 29, 2020

Well, my team just re-wrote all our lettuce tests in Cypress, so that's one way to move forward here.

@sugizo
Copy link

sugizo commented Jan 30, 2021

$ python -V
Python 3.8.5
$ conda -V
conda 4.9.2
$ lettuce
Traceback (most recent call last):
  File "/Users/sugizo/miniconda3/envs/python3_test/bin/lettuce", line 5, in <module>
    from lettuce.bin import main
  File "/Users/sugizo/miniconda3/envs/python3_test/lib/python3.8/site-packages/lettuce/__init__.py", line 179
    print "Error loading step definitions:\n", e
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Error loading step definitions:\n", e)?

is this error related to python 3 support ?

thanks

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

No branches or pull requests