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

Mvdb/harvest command use argparse #527

Merged

Conversation

m-vdb
Copy link
Contributor

@m-vdb m-vdb commented Jul 28, 2016

Hi @gabrielfalcao,

Another PR related to Django 1.9: all commands now use argparse by default. So this PR switches the command from optparse to argparse. The bad thing about that is that this break compatibility with Django 1.7. The good thing is that your command will be instantly compatible with 1.10 (almost out ;)).

LMK if you want to merge it or wait a little bit

class Command(BaseCommand):
help = u'Run lettuce tests all along installed apps'
args = '[PATH to feature file or folder]'
requires_model_validation = requires_system_checks = False
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this line gives an error on Django==1.8, so that's why I replaced it below with something smarter

class Command(BaseCommand):
help = u'Run lettuce tests all along installed apps'
args = '[PATH to feature file or folder]'
requires_model_validation = requires_system_checks = False

if DJANGO_VERSION < StrictVersion('1.9'):
Copy link
Contributor

@nikolas nikolas Aug 10, 2016

Choose a reason for hiding this comment

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

This clause is unnecessary - we can just use requires_system_checks with Django 1.8 as well as Django 1.9.

@m-vdb
Copy link
Contributor Author

m-vdb commented Sep 15, 2016

also, it works like a charm with Django 1.10.1 😄

@m-vdb
Copy link
Contributor Author

m-vdb commented Sep 15, 2016

@gabrielfalcao @nikolas do you think we could merge that?

@gabrielfalcao gabrielfalcao merged commit 6d68a72 into gabrielfalcao:master Sep 19, 2016
@m-vdb m-vdb deleted the mvdb/harvest-command-use-argparse branch September 19, 2016 15:26
@kairatomurbek2
Copy link

Hi @gabrielfalcao, manage.py harvest now working in django 10. Why does not it work ?

@kairatomurbek2
Copy link

Hi @m-vdb, manage.py harvest now working in django 10. Why does not it work ?

@m-vdb
Copy link
Contributor Author

m-vdb commented Oct 20, 2016

@kairatomurbek2 it works well for us with Django 1.10.1. open an issue on this project with sufficient debugging information if you need help.

@kairatomurbek2
Copy link

@m-vdb Yes, I need help, I use Django 1.10.2 I have this error goes here
File "/home/kayrat/projects/marketplace/virtualenv/local/lib/python2.7/site-packages/lettuce/django/management/commands/harvest.py", line 43, in Command
option_list = BaseCommand.option_list + (
AttributeError: type object 'BaseCommand' has no attribute 'option_lis
comand ./manage.py harvest acceptance_tests/features --settings=main.settings_test --debug-mode

@kairatomurbek2
Copy link

Yes I need help, I have a Django 1.10.2 I run, but for some reason does not
work. Now this error
File
"/home/kayrat/projects/marketplace/virtualenv/local/lib/python2.7/site-packages/lettuce/django/management/commands/harvest.py",
line 43, in Command
option_list = BaseCommand.option_list + (
AttributeError: type object 'BaseCommand' has no attribute 'option_list'

./manage.py harvest acceptance_tests/features --settings=main.settings_test
--debug-mode

On Fri, Oct 21, 2016 at 12:27 AM, Maxime Vdb [email protected]
wrote:

@kairatomurbek2 https://github.com/kairatomurbek2 it works well for us
with Django 1.10.1. open an issue on this project with sufficient debugging
information if you need help.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#527 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFrePgc5I8nuooF-clqFTJWqk3d2r1rAks5q17KpgaJpZM4JXsd8
.

С уважением !
Омурбек уулу Кайрат
+996(0700)13-96-80
e-mail: [email protected]
skype: lolakt1

@m-vdb
Copy link
Contributor Author

m-vdb commented Oct 27, 2016

as you can see in the code of this repo, you won't find any reference to BaseCommand.option_list here. My guess is that you don't have the latest version of lettuce.

@kairatomurbek2
Copy link

@m-vdb I have the latest version, I created a test project to test volatile, check please. https://github.com/kairatomurbek2/for_lettuce

@kairatomurbek2
Copy link

@m-vdb I'm still the same error comes

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