Re: 1.8 shipping invalid .py files in the startapp template

2016-01-11 Thread Tim Graham
Seems reasonable to me.

On Monday, January 11, 2016 at 10:24:18 AM UTC-5, Carl Johnson wrote:
>
> I think the template files should be shipped out as .py-tpl, since that's 
> their type (a Python template), and the resulting final files should just 
> have the extension renamed. Having two extension is just confusing and 
> leads to questions like this one about other kinds of templates.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/98f2a5a1-53bf-488d-847c-98407e16312d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2016-01-11 Thread Carl Johnson
I think the template files should be shipped out as .py-tpl, since that's 
their type (a Python template), and the resulting final files should just 
have the extension renamed. Having two extension is just confusing and 
leads to questions like this one about other kinds of templates.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ed0b6b0e-4ff5-47b9-a887-64ff34dcd648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2016-01-06 Thread Claude Paroz
Le mercredi 6 janvier 2016 19:34:07 UTC+1, Tim Graham a écrit :
>
> The current pull request proposes to make a backwards-incompatible change 
> by chopping off any ".tpl" suffix in app or project template files. i.e. 
> "If you are using custom templates and these templates already use a 
> ``.tpl``  suffix, you will need to append an additional ``.tpl`` (ie. 
> ``filename.tpl.tpl``)".
>
> Do you find this change acceptable in a minor release (1.9.2)? If not, we 
> could possibly limit the behavior to the templates in "django/conf".
>
> https://github.com/django/django/pull/5735
>

What about limiting chopping to ".py.tpl" => ".py"?

Claude

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/89b0bf06-ca2f-459a-b327-c1ed30317725%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2016-01-06 Thread Tim Graham
The current pull request proposes to make a backwards-incompatible change 
by chopping off any ".tpl" suffix in app or project template files. i.e. 
"If you are using custom templates and these templates already use a 
``.tpl``  suffix, you will need to append an additional ``.tpl`` (ie. 
``filename.tpl.tpl``)".

Do you find this change acceptable in a minor release (1.9.2)? If not, we 
could possibly limit the behavior to the templates in "django/conf".

https://github.com/django/django/pull/5735

On Monday, December 21, 2015 at 2:14:00 PM UTC-5, Carl Johnson wrote:
>
> FWIW, this also bit me. I have a deploy script that runs python -m 
> compileall as part of its build process. It was pretty easy to work around 
> by adding -x app_template, but why make everyone else work around Django? 
> ISTM it would be better to call the files .py_template instead since they 
> aren't valid Python.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9047e152-91bd-4bff-b6f5-2fa64670e7ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-12-21 Thread Carl Johnson
FWIW, this also bit me. I have a deploy script that runs python -m 
compileall as part of its build process. It was pretty easy to work around 
by adding -x app_template, but why make everyone else work around Django? 
ISTM it would be better to call the files .py_template instead since they 
aren't valid Python.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/e931889e-39f2-4067-91bb-a7c711cd346a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-12-08 Thread Raphael Hertzog
Hello,

I'm another Debian developer co-maintaining Django in Debian.

Le lundi 30 novembre 2015, Florian Apolloner a écrit :
> I am not against including it, but depending on how packaging works in 
> Debian it could be possible to call pycompile with a proper exclusion list 
> instead. The PR itself only works by accident, there are also files in 

We can always add many exceptions but in the end any distro packager wants
to avoid exceptions as we want to automate as much as possible
installations of Python modules (and update to new upstream versions
to make them quickly available to users).

There's a case to be made that the whole process should probably not loose the
information coming setup.py but I'd argue that this information is not
really useful information for packagers until it's properly stored in the
filesystem by the module installation process.

And I would also argue that this would then need to be fixed at the Python
level so that Data is actually stored in separate directories
(/usr/share/something) and not mixed up with Python code.

All in all, I believe our request to be reasonable and I would like
you to consider applying Chris's PR or similar code.

Thank you!

> That said, the amount of issues I have seen in #django due to the 
> debundling of pip in debian/ubuntu is not something I can count on one hand 
> anymore. Most of the time I just gave up and suggested to install pip 
> manually, all problems gone. The syntax error has popped up three times so 
> far (iirc) and requires no fixing aside from educating people.

I find it weird to have such feelings when you go to such lengths to
implement a very nice LTS support policy for Django itself.

Cheers,
-- 
Raphaël Hertzog ◈ Writer/Consultant ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/20151208082148.GB23223%40home.ouaza.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-30 Thread Florian Apolloner


On Monday, November 30, 2015 at 7:02:05 PM UTC+1, Tim Graham wrote:
>
> Florian, your preference is to decline the change proposed by Chris and 
> just deal with any support queries when people see a log like below? I 
> understand it's not ideal to add workarounds for bugs in other software as 
> the proposal does, but it seems like a pragmatic solution to me.
>

I am not against including it, but depending on how packaging works in 
Debian it could be possible to call pycompile with a proper exclusion list 
instead. The PR itself only works by accident, there are also files in 
project_template (namely the settings file and urls) which also should not 
get compiled (even if they are valid). So if you want to include the PR, 
please make sure it properly works for __all__ package data, not just the 
one with invalid data.

That said, the amount of issues I have seen in #django due to the 
debundling of pip in debian/ubuntu is not something I can count on one hand 
anymore. Most of the time I just gave up and suggested to install pip 
manually, all problems gone. The syntax error has popped up three times so 
far (iirc) and requires no fixing aside from educating people.

Cheers,
Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/3ed86d2e-a6a0-462f-90a9-dad59d9f70b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-30 Thread Tim Graham
Actually, the SyntaxError issue isn't related to pip but to setuptools 5.5 
and 5.5.1 (Debian stable ships the latter).

Florian, your preference is to decline the change proposed by Chris and 
just deal with any support queries when people see a log like below? I 
understand it's not ideal to add workarounds for bugs in other software as 
the proposal does, but it seems like a pragmatic solution to me.

$ pip install Django==1.9c2
Downloading/unpacking Django==1.9c2
  Downloading Django-1.9rc2-py2.py3-none-any.whl (6.4MB): 6.4MB downloaded
Installing collected packages: Django
  Found existing installation: Django 1.9c1
Uninstalling Django:
  Successfully uninstalled Django
Compiling 
/home/tim/.virtualenvs/tmp-65a61cac481337a0/build/Django/django/conf/app_template/apps.py
 
...
  File 
"/home/tim/.virtualenvs/tmp-65a61cac481337a0/build/Django/django/conf/app_template/apps.py",
 
line 4
class {{ camel_case_app_name }}Config(AppConfig):
  ^
SyntaxError: invalid syntax

Compiling 
/home/tim/.virtualenvs/tmp-65a61cac481337a0/build/Django/django/conf/app_template/models.py
 
...
  File 
"/home/tim/.virtualenvs/tmp-65a61cac481337a0/build/Django/django/conf/app_template/models.py",
 
line 1
{{ unicode_literals }}from django.db import models
 ^
SyntaxError: invalid syntax

Successfully installed Django
Cleaning up...

On Saturday, November 28, 2015 at 8:47:13 PM UTC-5, Florian Apolloner wrote:
>
> Damn, I meant to write "and not real packages"
>
> On Sunday, November 29, 2015 at 2:46:22 AM UTC+1, Florian Apolloner wrote:
>>
>>
>>
>> On Saturday, November 28, 2015 at 7:16:10 PM UTC+1, lamby wrote:
>>>
>>> > at least project_template would be missing etc
>>>
>>> Deliberately so; these are not invalid .py files.
>>>
>>
>> Yes, but by luck and/or accident. In the end they are still package data 
>> and real packages, so you should never run pycompile on them in the first 
>> place. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a2353277-0b8b-4d64-8ef0-661afeecfdf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Florian Apolloner
Damn, I meant to write "and not real packages"

On Sunday, November 29, 2015 at 2:46:22 AM UTC+1, Florian Apolloner wrote:
>
>
>
> On Saturday, November 28, 2015 at 7:16:10 PM UTC+1, lamby wrote:
>>
>> > at least project_template would be missing etc
>>
>> Deliberately so; these are not invalid .py files.
>>
>
> Yes, but by luck and/or accident. In the end they are still package data 
> and real packages, so you should never run pycompile on them in the first 
> place. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c5cd53d9-26a9-446e-884b-73bf96db9be9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Florian Apolloner


On Saturday, November 28, 2015 at 7:16:10 PM UTC+1, lamby wrote:
>
> > at least project_template would be missing etc
>
> Deliberately so; these are not invalid .py files.
>

Yes, but by luck and/or accident. In the end they are still package data 
and real packages, so you should never run pycompile on them in the first 
place. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9e320e32-01fe-46d8-9318-a20c62832082%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread lamby
> I believe this is a new issue in 1.9, not 1.8 as the subject says, 
correct?

Correct, apologies. (I meant to write "since 1.8" as "1.9" is either 
ambiguous or not released yet.)
 
> Is the "man-page of pycompile you can exclude certain packages" 
suggestion some change we should make in Django?

Not really; it would simply be moving the special-casing around a bit.

> at least project_template would be missing etc

Deliberately so; these are not invalid .py files.


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d0ac5026-e6a6-4dd4-b31e-dd7987421410%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Tim Graham
"Force" or "nudge" to upgrade pip? i.e. should Django not install with pip 
< some version? That seems controversial.

Is the "man-page of pycompile you can exclude certain packages" suggestion 
some change we should make in Django? As long as we have some solution to 
avoid support queries about this problem, I don't care which one we choose.

On Saturday, November 28, 2015 at 12:52:56 PM UTC-5, Florian Apolloner 
wrote:
>
> If I am not mistaken 1.5.6 is still one of those versions which whould 
> install from external sources etc… So from a security point of view I wanna 
> force people to upgrade. 
>
> Regarding purity: No it is not purity, as the PR already showed, at least 
> project_template would be missing etc… Also this is not a problem of Django 
> but rather packaging in distribution, ie affects more packages to Django. 
> So why add a specialcased solution in Django if we maybe should fix 
> packaging instead?
>
> On Saturday, November 28, 2015 at 5:03:12 PM UTC+1, Tim Graham wrote:
>>
>> Claude said, "I also encountered this error when using pip 1.5.6 (default 
>> version in Debian stable)." I guess at least some people might not want to 
>> upgrade system packages.
>>
>> Is your main opposition to the change a "purity" one? Sure, we could add 
>> a pip version check, but I don't see any downside to the proposed change.
>>
>> On Saturday, November 28, 2015 at 10:53:54 AM UTC-5, Florian Apolloner 
>> wrote:
>>>
>>> I rather add a check to setup.py and tell people to upgrade pip
>>>
>>> On Saturday, November 28, 2015 at 1:46:48 PM UTC+1, Tim Graham wrote:

 I believe this is a new issue in 1.9, not 1.8 as the subject says, 
 correct?

 I wouldn't mind seeing it fixed as old versions of pip report a 
 SyntaxError when installing Django (this doesn't affect the install, but 
 creates confusion for users and resulted in at least two bug reports like 
 https://code.djangoproject.com/ticket/25584).

 On Saturday, November 28, 2015 at 6:38:00 AM UTC-5, Florian Apolloner 
 wrote:
>
> Hi,
>
> Those packages/modules are clearly marked as package data (
> https://github.com/django/django/blob/master/setup.py#L26-L28), so 
> imo it is a bug in Debian packaging (although I do understand that it 
> might 
> not be the easiest to fix…). According to the man-page of pycompile you 
> can 
> exclude certain packages, this is imo the way to go.
>
> Cheers,
> Florian
>
> P.S.: Also you seem to miss the project_template in your PR.
>
> On Saturday, November 28, 2015 at 12:26:27 PM UTC+1, lamby wrote:
>>
>> Hi, 
>>
>> I sent this first as a pull request — talk is cheap, code is better, 
>> etc. — but now feel I should I have posted here first. 
>>
>> The underlying issue is that Debian packages unconditionally 
>> byte-compile .py files under dist-packages upon installation using 
>> `pycompile` and do not silence errors by design. Thus the "invalid" 
>> files that form part of the `startapp` template require tedious 
>> special 
>> attention to avoid errors. 
>>
>> I'm sure this would affect other, non-Debian, packaging systems, as 
>> well 
>> as surface weird behaviour elsewhere. Shipping broken .py files 
>> masquerading as valid ones additionally just feels dirty. 
>>
>> We templated .py files before, but as the '{{ foo }}' bits were 
>> inside 
>> strings, docstrings or comments, the pre-rendered templates were 
>> perfectly valid Python. 
>>
>> Therefore I think need a way of shipping the "invalid" .py files that 
>> form part of the `startapp` template without .py extensions but, of 
>> course, ensuring they end up as .py after rendering. (Or we use some 
>> entirely different mechanism.) 
>>
>> My current implementation is 
>> ; see some additional 
>> comments I made there. 
>>
>>
>> Regards, 
>>
>> -- 
>> Chris Lamb 
>> chris-lamb.co.uk / @lolamby 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/0ac2d962-95f9-491a-8b8b-e37646109d61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Florian Apolloner
If I am not mistaken 1.5.6 is still one of those versions which whould 
install from external sources etc… So from a security point of view I wanna 
force people to upgrade. 

Regarding purity: No it is not purity, as the PR already showed, at least 
project_template would be missing etc… Also this is not a problem of Django 
but rather packaging in distribution, ie affects more packages to Django. 
So why add a specialcased solution in Django if we maybe should fix 
packaging instead?

On Saturday, November 28, 2015 at 5:03:12 PM UTC+1, Tim Graham wrote:
>
> Claude said, "I also encountered this error when using pip 1.5.6 (default 
> version in Debian stable)." I guess at least some people might not want to 
> upgrade system packages.
>
> Is your main opposition to the change a "purity" one? Sure, we could add a 
> pip version check, but I don't see any downside to the proposed change.
>
> On Saturday, November 28, 2015 at 10:53:54 AM UTC-5, Florian Apolloner 
> wrote:
>>
>> I rather add a check to setup.py and tell people to upgrade pip
>>
>> On Saturday, November 28, 2015 at 1:46:48 PM UTC+1, Tim Graham wrote:
>>>
>>> I believe this is a new issue in 1.9, not 1.8 as the subject says, 
>>> correct?
>>>
>>> I wouldn't mind seeing it fixed as old versions of pip report a 
>>> SyntaxError when installing Django (this doesn't affect the install, but 
>>> creates confusion for users and resulted in at least two bug reports like 
>>> https://code.djangoproject.com/ticket/25584).
>>>
>>> On Saturday, November 28, 2015 at 6:38:00 AM UTC-5, Florian Apolloner 
>>> wrote:

 Hi,

 Those packages/modules are clearly marked as package data (
 https://github.com/django/django/blob/master/setup.py#L26-L28), so imo 
 it is a bug in Debian packaging (although I do understand that it might 
 not 
 be the easiest to fix…). According to the man-page of pycompile you can 
 exclude certain packages, this is imo the way to go.

 Cheers,
 Florian

 P.S.: Also you seem to miss the project_template in your PR.

 On Saturday, November 28, 2015 at 12:26:27 PM UTC+1, lamby wrote:
>
> Hi, 
>
> I sent this first as a pull request — talk is cheap, code is better, 
> etc. — but now feel I should I have posted here first. 
>
> The underlying issue is that Debian packages unconditionally 
> byte-compile .py files under dist-packages upon installation using 
> `pycompile` and do not silence errors by design. Thus the "invalid" 
> files that form part of the `startapp` template require tedious 
> special 
> attention to avoid errors. 
>
> I'm sure this would affect other, non-Debian, packaging systems, as 
> well 
> as surface weird behaviour elsewhere. Shipping broken .py files 
> masquerading as valid ones additionally just feels dirty. 
>
> We templated .py files before, but as the '{{ foo }}' bits were inside 
> strings, docstrings or comments, the pre-rendered templates were 
> perfectly valid Python. 
>
> Therefore I think need a way of shipping the "invalid" .py files that 
> form part of the `startapp` template without .py extensions but, of 
> course, ensuring they end up as .py after rendering. (Or we use some 
> entirely different mechanism.) 
>
> My current implementation is 
> ; see some additional 
> comments I made there. 
>
>
> Regards, 
>
> -- 
> Chris Lamb 
> chris-lamb.co.uk / @lolamby 
>


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/65c05a41-e576-42a2-98ba-1ec3ea094b36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Tim Graham
Yes, I know but it creates confusion for users and has resulted in at least 
two bug reports like https://code.djangoproject.com/ticket/25584. I suspect 
we'll see more reports and queries about it once 1.9 goes final so I'd like 
to avoid that as long as there isn't any downside to the proposed change.

On Saturday, November 28, 2015 at 11:05:59 AM UTC-5, Donald Stufft wrote:
>
>
> On Nov 28, 2015, at 11:03 AM, Tim Graham  
> wrote:
>
> Claude said, "I also encountered this error when using pip 1.5.6 (default 
> version in Debian stable)." I guess at least some people might not want to 
> upgrade system packages.
>
> Is your main opposition to the change a "purity" one? Sure, we could add a 
> pip version check, but I don't see any downside to the proposed change.
>
>
> pip 1.5.6 will print the warning but it’s just a warning. Newer pips will 
> silence it. A failure to compile to .pyc never fails the install for pip.
>
> -
> Donald Stufft
> PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 
> DCFA 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/443288e6-5105-41f0-8496-ee955babafee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Donald Stufft

> On Nov 28, 2015, at 11:03 AM, Tim Graham  wrote:
> 
> Claude said, "I also encountered this error when using pip 1.5.6 (default 
> version in Debian stable)." I guess at least some people might not want to 
> upgrade system packages.
> 
> Is your main opposition to the change a "purity" one? Sure, we could add a 
> pip version check, but I don't see any downside to the proposed change.
> 


pip 1.5.6 will print the warning but it’s just a warning. Newer pips will 
silence it. A failure to compile to .pyc never fails the install for pip.

-
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/322CC149-D15F-4125-8A3A-7DE9F7895797%40stufft.io.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Tim Graham
Claude said, "I also encountered this error when using pip 1.5.6 (default 
version in Debian stable)." I guess at least some people might not want to 
upgrade system packages.

Is your main opposition to the change a "purity" one? Sure, we could add a 
pip version check, but I don't see any downside to the proposed change.

On Saturday, November 28, 2015 at 10:53:54 AM UTC-5, Florian Apolloner 
wrote:
>
> I rather add a check to setup.py and tell people to upgrade pip
>
> On Saturday, November 28, 2015 at 1:46:48 PM UTC+1, Tim Graham wrote:
>>
>> I believe this is a new issue in 1.9, not 1.8 as the subject says, 
>> correct?
>>
>> I wouldn't mind seeing it fixed as old versions of pip report a 
>> SyntaxError when installing Django (this doesn't affect the install, but 
>> creates confusion for users and resulted in at least two bug reports like 
>> https://code.djangoproject.com/ticket/25584).
>>
>> On Saturday, November 28, 2015 at 6:38:00 AM UTC-5, Florian Apolloner 
>> wrote:
>>>
>>> Hi,
>>>
>>> Those packages/modules are clearly marked as package data (
>>> https://github.com/django/django/blob/master/setup.py#L26-L28), so imo 
>>> it is a bug in Debian packaging (although I do understand that it might not 
>>> be the easiest to fix…). According to the man-page of pycompile you can 
>>> exclude certain packages, this is imo the way to go.
>>>
>>> Cheers,
>>> Florian
>>>
>>> P.S.: Also you seem to miss the project_template in your PR.
>>>
>>> On Saturday, November 28, 2015 at 12:26:27 PM UTC+1, lamby wrote:

 Hi, 

 I sent this first as a pull request — talk is cheap, code is better, 
 etc. — but now feel I should I have posted here first. 

 The underlying issue is that Debian packages unconditionally 
 byte-compile .py files under dist-packages upon installation using 
 `pycompile` and do not silence errors by design. Thus the "invalid" 
 files that form part of the `startapp` template require tedious special 
 attention to avoid errors. 

 I'm sure this would affect other, non-Debian, packaging systems, as 
 well 
 as surface weird behaviour elsewhere. Shipping broken .py files 
 masquerading as valid ones additionally just feels dirty. 

 We templated .py files before, but as the '{{ foo }}' bits were inside 
 strings, docstrings or comments, the pre-rendered templates were 
 perfectly valid Python. 

 Therefore I think need a way of shipping the "invalid" .py files that 
 form part of the `startapp` template without .py extensions but, of 
 course, ensuring they end up as .py after rendering. (Or we use some 
 entirely different mechanism.) 

 My current implementation is 
 ; see some additional 
 comments I made there. 


 Regards, 

 -- 
 Chris Lamb 
 chris-lamb.co.uk / @lolamby 

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/e054cc18-e19f-41d9-8991-a010d5089c61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Florian Apolloner
I rather add a check to setup.py and tell people to upgrade pip

On Saturday, November 28, 2015 at 1:46:48 PM UTC+1, Tim Graham wrote:
>
> I believe this is a new issue in 1.9, not 1.8 as the subject says, correct?
>
> I wouldn't mind seeing it fixed as old versions of pip report a 
> SyntaxError when installing Django (this doesn't affect the install, but 
> creates confusion for users and resulted in at least two bug reports like 
> https://code.djangoproject.com/ticket/25584).
>
> On Saturday, November 28, 2015 at 6:38:00 AM UTC-5, Florian Apolloner 
> wrote:
>>
>> Hi,
>>
>> Those packages/modules are clearly marked as package data (
>> https://github.com/django/django/blob/master/setup.py#L26-L28), so imo 
>> it is a bug in Debian packaging (although I do understand that it might not 
>> be the easiest to fix…). According to the man-page of pycompile you can 
>> exclude certain packages, this is imo the way to go.
>>
>> Cheers,
>> Florian
>>
>> P.S.: Also you seem to miss the project_template in your PR.
>>
>> On Saturday, November 28, 2015 at 12:26:27 PM UTC+1, lamby wrote:
>>>
>>> Hi, 
>>>
>>> I sent this first as a pull request — talk is cheap, code is better, 
>>> etc. — but now feel I should I have posted here first. 
>>>
>>> The underlying issue is that Debian packages unconditionally 
>>> byte-compile .py files under dist-packages upon installation using 
>>> `pycompile` and do not silence errors by design. Thus the "invalid" 
>>> files that form part of the `startapp` template require tedious special 
>>> attention to avoid errors. 
>>>
>>> I'm sure this would affect other, non-Debian, packaging systems, as well 
>>> as surface weird behaviour elsewhere. Shipping broken .py files 
>>> masquerading as valid ones additionally just feels dirty. 
>>>
>>> We templated .py files before, but as the '{{ foo }}' bits were inside 
>>> strings, docstrings or comments, the pre-rendered templates were 
>>> perfectly valid Python. 
>>>
>>> Therefore I think need a way of shipping the "invalid" .py files that 
>>> form part of the `startapp` template without .py extensions but, of 
>>> course, ensuring they end up as .py after rendering. (Or we use some 
>>> entirely different mechanism.) 
>>>
>>> My current implementation is 
>>> ; see some additional 
>>> comments I made there. 
>>>
>>>
>>> Regards, 
>>>
>>> -- 
>>> Chris Lamb 
>>> chris-lamb.co.uk / @lolamby 
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/de2a564c-e14d-443f-b67f-cc39c036dfe3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Tim Graham
I believe this is a new issue in 1.9, not 1.8 as the subject says, correct?

I wouldn't mind seeing it fixed as old versions of pip report a SyntaxError 
when installing Django (this doesn't affect the install, but creates 
confusion for users and resulted in at least two bug reports like 
https://code.djangoproject.com/ticket/25584).

On Saturday, November 28, 2015 at 6:38:00 AM UTC-5, Florian Apolloner wrote:
>
> Hi,
>
> Those packages/modules are clearly marked as package data (
> https://github.com/django/django/blob/master/setup.py#L26-L28), so imo it 
> is a bug in Debian packaging (although I do understand that it might not be 
> the easiest to fix…). According to the man-page of pycompile you can 
> exclude certain packages, this is imo the way to go.
>
> Cheers,
> Florian
>
> P.S.: Also you seem to miss the project_template in your PR.
>
> On Saturday, November 28, 2015 at 12:26:27 PM UTC+1, lamby wrote:
>>
>> Hi, 
>>
>> I sent this first as a pull request — talk is cheap, code is better, 
>> etc. — but now feel I should I have posted here first. 
>>
>> The underlying issue is that Debian packages unconditionally 
>> byte-compile .py files under dist-packages upon installation using 
>> `pycompile` and do not silence errors by design. Thus the "invalid" 
>> files that form part of the `startapp` template require tedious special 
>> attention to avoid errors. 
>>
>> I'm sure this would affect other, non-Debian, packaging systems, as well 
>> as surface weird behaviour elsewhere. Shipping broken .py files 
>> masquerading as valid ones additionally just feels dirty. 
>>
>> We templated .py files before, but as the '{{ foo }}' bits were inside 
>> strings, docstrings or comments, the pre-rendered templates were 
>> perfectly valid Python. 
>>
>> Therefore I think need a way of shipping the "invalid" .py files that 
>> form part of the `startapp` template without .py extensions but, of 
>> course, ensuring they end up as .py after rendering. (Or we use some 
>> entirely different mechanism.) 
>>
>> My current implementation is 
>> ; see some additional 
>> comments I made there. 
>>
>>
>> Regards, 
>>
>> -- 
>> Chris Lamb 
>> chris-lamb.co.uk / @lolamby 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/278fc7b4-bd40-443f-8842-002301eea689%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Florian Apolloner
Hi,

Those packages/modules are clearly marked as package data 
(https://github.com/django/django/blob/master/setup.py#L26-L28), so imo it 
is a bug in Debian packaging (although I do understand that it might not be 
the easiest to fix…). According to the man-page of pycompile you can 
exclude certain packages, this is imo the way to go.

Cheers,
Florian

P.S.: Also you seem to miss the project_template in your PR.

On Saturday, November 28, 2015 at 12:26:27 PM UTC+1, lamby wrote:
>
> Hi, 
>
> I sent this first as a pull request — talk is cheap, code is better, 
> etc. — but now feel I should I have posted here first. 
>
> The underlying issue is that Debian packages unconditionally 
> byte-compile .py files under dist-packages upon installation using 
> `pycompile` and do not silence errors by design. Thus the "invalid" 
> files that form part of the `startapp` template require tedious special 
> attention to avoid errors. 
>
> I'm sure this would affect other, non-Debian, packaging systems, as well 
> as surface weird behaviour elsewhere. Shipping broken .py files 
> masquerading as valid ones additionally just feels dirty. 
>
> We templated .py files before, but as the '{{ foo }}' bits were inside 
> strings, docstrings or comments, the pre-rendered templates were 
> perfectly valid Python. 
>
> Therefore I think need a way of shipping the "invalid" .py files that 
> form part of the `startapp` template without .py extensions but, of 
> course, ensuring they end up as .py after rendering. (Or we use some 
> entirely different mechanism.) 
>
> My current implementation is 
> ; see some additional 
> comments I made there. 
>
>
> Regards, 
>
> -- 
> Chris Lamb 
> chris-lamb.co.uk / @lolamby 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/43aba911-9cae-47f5-9b1e-317c826c49a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


1.8 shipping invalid .py files in the startapp template

2015-11-28 Thread Chris Lamb
Hi,

I sent this first as a pull request — talk is cheap, code is better,
etc. — but now feel I should I have posted here first.

The underlying issue is that Debian packages unconditionally
byte-compile .py files under dist-packages upon installation using
`pycompile` and do not silence errors by design. Thus the "invalid"
files that form part of the `startapp` template require tedious special
attention to avoid errors.

I'm sure this would affect other, non-Debian, packaging systems, as well
as surface weird behaviour elsewhere. Shipping broken .py files
masquerading as valid ones additionally just feels dirty.

We templated .py files before, but as the '{{ foo }}' bits were inside
strings, docstrings or comments, the pre-rendered templates were
perfectly valid Python.

Therefore I think need a way of shipping the "invalid" .py files that
form part of the `startapp` template without .py extensions but, of
course, ensuring they end up as .py after rendering. (Or we use some
entirely different mechanism.)

My current implementation is
; see some additional
comments I made there.


Regards,

-- 
Chris Lamb
chris-lamb.co.uk / @lolamby

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1448709971.2122465.452093193.792C15B7%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.