Il 17/11/2016 16:39, Brian Rutledge ha scritto:
> In the process of submitting a PR for djangocms-style
> <
https://github.com/divio/djangocms-style/pull/33>, I ran into some
> snags with getting my development environment set up. I started by
> following the instructions under Running Tests
> <
https://github.com/divio/djangocms-style#running-tests>, but running
> `python setup.py test` resulted in the following error:
>
> pkg_resources.VersionConflict: (Django 1.10.3
> (/Users/brian/.virtualenvs/djangocms-style/lib/python2.7/site-packages),
> Requirement.parse('django<1.10,>=1.8'))
>
>
> It looks like djangocms-helper from tests/requirements.txt
> <
https://github.com/divio/djangocms-style/blob/master/tests/requirements.txt>
> doesn't specify a Django version in its setup.py
> <
https://github.com/nephila/djangocms-helper/blob/develop/setup.py>, so
> the latest is installed, but that conflicts with the django CMS
> requirement. So, I did a manual install of Django 1.9.11, and then
> `python setup.py test` passed, which was sufficient for the work that I
> was doing.
>
> However, it looks to me like more involved work would require using
> `djangocms_helper` to make migrations, etc. But, running
> `djangocms-helper djangocms_style test --cms` in a fresh virtualenv
> after `pip install -r tests/requirements.txt` gives me this error:
>
> ImportError: No module named djangocms_admin_style
>
>
> The How to use docs
> <
https://djangocms-helper.readthedocs.io/en/develop/introduction.html> indicate
> that django CMS needs to be installed, but I don't know the "right way"
> to do that for plugin development. It's worth noting that I haven't
> really worked on pip-installable projects before, so I'm not familiar
> with how to use `setup.py` during development.
>
> So, I'd like to understand how django CMS contributors work on plugins.
> Once I understand the process, I'm happy to improve the docs, if needed.
>
For djangocms-helper to work, it needs the "helper file" (e.g: a special
file with custom settings and few functions).
The default helper file is cms_helper.py file in the git repository root.
You can easily integrate djangocms-helper with python setup.py using the
test_suite argument (see
https://djangocms-helper.readthedocs.io/en/develop/runner.html#integrated-runner),
but this will only work for running tests.
For all the other commands, like running migrations, you have to
explicitly tell the path of the settings file.
So the makemigrations command is something like:
djangocms-helper djangocms_style makemigrations
--extra-settings=tests/settings.py --cms
As the settings.py is configured as integrated runner you can actually
run commands in a simpler way:
python tests/settings.py makemigrations
Probably it just worth to mention the latter form in the readme
To properly setup the environment, I think it's easier if you just run
tox which knows all the versioned dependencies intricacies:
tox -epy27-dj19-cms33
will run the tests against the given set of python/django/cms
After that, you can easily reuse the same virtualenv to run commands etc.
I hope I answered your questions
> --
> Message URL: *MailScanner has detected definite fraud in the website at
> "
groups.google.com". Do /not/ trust this website:*
>
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id <
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id>
> Unsubscribe: send a message to
>
django-cms-devel...@googlegroups.com
> ---
> You received this message because you are subscribed to the Google
> Groups "django CMS developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
django-cms-devel...@googlegroups.com
> <mailto:
django-cms-devel...@googlegroups.com>.
> To view this discussion on the web, visit *MailScanner has detected
> definite fraud in the website at "
groups.google.com". Do /not/ trust
> this website:*
>
https://groups.google.com/d/msgid/django-cms-developers/cfb509d7-73f9-4340-b41f-8f0a9b4b45d0%40googlegroups.com
> <
https://groups.google.com/d/msgid/django-cms-developers/cfb509d7-73f9-4340-b41f-8f0a9b4b45d0%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit *MailScanner has detected definite fraud in the
> website at "
groups.google.com". Do /not/ trust this website:*
>
https://groups.google.com/d/optout <
https://groups.google.com/d/optout>.
--
Iacopo Spalletti
Nephila s.a.s. - Firenze
Telefono:
+39 055 5357189
Assistenza Tecnica:
+39 055 3985730
http://nephi.la