Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-12 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Ready for
  frozen, cx_Freeze  |  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 Would you like to offer a patch that reverts
 51673c146e48ff6230eace39bac18fd555607bee and makes the migration loader
 catch a `ImportError: bad magic number` exception and reraise it with a
 message that informs the user to delete pyc files?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.20af5c9018199d97ad845166737e8438%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-12 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Ready for
  frozen, cx_Freeze  |  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Dan Watson):

 The only time I could see `.pyc` files hanging around is if you're sharing
 a local copy of a third-party application between two different versions
 of Python (i.e. `pip install -e` in both environments). And presumably the
 main motivation behind the original decision to ignore `.pyc` files
 (switching branches leaving stale files) does not apply nearly as much to
 third-party apps you are using as code you are developing. But like
 Carlton said, programming is weird and wonderful, so nothing would
 surprise me.

 I think the biggest "risk" in reverting
 51673c146e48ff6230eace39bac18fd555607bee is for a project initially
 switching to Python 3 (and Django 2.x), where the migrations directories
 may already contain stale `.pyc` files. Seems like a documentation note
 about clearing out `.pyc` files might be in order. If I'm not mistaken, we
 have similar issues with templatetags - the templatetags loader uses
 `pkgutil`:

 
https://github.com/django/django/blob/master/django/template/backends/django.py#L114

 So I think a note about clearing out `.pyc` files is a good idea
 regardless. Obviously I'm biased, but I think the fact that this has been
 an issue for 3-4 years is not a good reason to wait 2 more years to rip
 off the bandaid. Unless Django as a project decides it doesn't want to
 officially "support" frozen/sourceless environments, which I think would
 also be a shame, given how close it already is.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.be34be55af421826044911a1bcf9b80c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-12 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Ready for
  frozen, cx_Freeze  |  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 If third-party apps continue to support Python 2 until it's EOL in 2020,
 then there's a possibility pyc files will be generated. If we revert
 51673c146e48ff6230eace39bac18fd555607bee, then using a version of Django
 that doesn't ignore pyc files will given an exception like `ImportError:
 bad magic number in 'polls.migrations.0002_auto_20180312_1426':
 b'\x03\xf3\r\n'` if a Python 2 pyc file is present. Manually removing pyc
 files fixes that. If we decided to revert
 51673c146e48ff6230eace39bac18fd555607bee for Django 2.1, I think it would
 be useful to add a more helpful message about the magic number error
 instructing the user to manually remove pyc files. I'm not sure if the
 extra hassle in that use case is worth the trade off of supporting frozen
 environments (assuming that Python 3 frozen environments generate pyc
 files -- I'm not sure about this as I haven't used frozen environments
 before).

 By Django 3.1 (released August 2020), I think we can safely assume most
 apps won't support Python 2, so we could revert the pyc ignoring in Django
 without much concern. The `MIGRATIONS_INCLUDE_PYC` setting would allow
 more easily using frozen environments in Django 2.1 (to be released August
 2018), two years earlier than if we take the alternate route. Given the
 problem is there since Django 1.7 (September 2014), I don't know if two
 more years makes much difference.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.1ab2766e2be48eaa1b1555cb8aec5db3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-12 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Ready for
  frozen, cx_Freeze  |  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Carlton Gibson):

 The "some advantage" is in being able to ship a `.pyc` only version of you
 code. This isn't something I've done but, reviewing the issue it seemed a
 reasonable use-case. (The discussion ≈3 years ago didn't close...)

 As far as I can see, in this Python 3 world you're only going to run into
 this if you're deliberately creating the legacy `.pyc` files. In that case
 you should already know what you're doing.
 You're not going to hit anything that a `find . -name '*.pyc' -delete`
 won't fix.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.081307317ca76eb1e41b9c156c8daa74%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-12 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Ready for
  frozen, cx_Freeze  |  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 I also don't see the purpose of adding the setting at this point. If
 there's some advantage to reverting the ignoring of pyc files, then I'd
 rather do that now instead of adding a setting for it.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.d2f68fcee1de447bd2611ad457a5c3d0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-12 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Ready for
  frozen, cx_Freeze  |  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Claude Paroz):

 Adding a new setting around `.pyc` files in Django 2.1 looks very
 outdated. I'm in favour of `won't fix`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.f9eca1ef1b51690bbe86137fda4ebb6c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-12 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Ready for
  frozen, cx_Freeze  |  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * stage:  Accepted => Ready for checkin


Comment:

 I don't want this one to slip through the cracks because of the revert
 /not-revert question.

 I've re-opened Dan's PR and marked it RFC. We should either merge it, or
 decide that reverting is OK (or close as `wontfix`).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.e2549fc38cfa0d4038232c3eb213b904%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-08 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Carlton Gibson):

 Replying to [comment:28 Tim Graham]:
 > Is there a disadvantage to waiting to revert
 51673c146e48ff6230eace39bac18fd555607bee until after Python 2 is end-of-
 life in 2020? I'm not really sure, but ignoring of pyc files may still
 have some value as long as third-party apps  support Python 2 and 3.

 I can't quite see how an issue would come up (given that this would go
 into Django 2.1, which is Python 3 only) but I can't rule it out either.
 (There's nothing so weird and wonderful as programming. :)

 There's no disadvantage really. Dan's PR is clean enough. If we're not
 going to revert 51673c14 (and not go for wontfix) I think we should re-
 open the PR and treat it as Ready for checkin, for a final review from
 you. (I was at the point of marking it so, bar the revert option coming
 up.)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.61e221f1cb1a340df970cd52ea26348a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-08 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 Is there a disadvantage to waiting to revert
 51673c146e48ff6230eace39bac18fd555607bee until after Python 2 is end-of-
 life in 2020? I'm not really sure, but ignoring of pyc files may still
 have some value as long as third-party apps  support Python 2 and 3.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.4a00c6e4957756912e13edd5d7ebf553%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-08 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * has_patch:  1 => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.19b74ec31d6c7d426ec66464d77ba5c4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-08 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Carlton Gibson):

 Dan can you close your existing PR and open a new one reverting the
 original change (explaining why that's OK now)?

 From there we'll mark that RFC and get Tim to make a final review.

 (We'll either revert, or say "no, lets take the patch", or failing that
 the only other option is `wontfix` — either way we'll get this one
 resolved.)

 Thanks!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.5f27df6fd26e50a075f2d57498063509%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-07 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Dan Watson):

 I'm actually in favor of reverting. Hadn't considered that now that Django
 is Python 3 only. If you have legacy stale pyc files, it's because you
 compiled them yourself now, which means you'd probably be using this
 setting. So why have the setting at all :)

 I wonder what Python 3 does when it sees a pyc file compiled with Python
 2. That would be the only place I could see breakage for existing projects
 with old Python 2 pyc files hanging around, but my guess is that they'd be
 ignored (or fail loudly and hopefully obviously).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.839e0100e8bc2979cffc05333dff8dd8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-03-07 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * cc: Carlton Gibson (added)


Comment:

 The patch as presented, and given the history of the ticket, looks great.

 Ref [comment:22 comment from Andrew Godwin]:
 > ... there are no longer any .pyc files in the migrations directory (they
 go into __pycache__) in Python 3 ...

 So, maybe the original problem (of stale .pyc files when switching
 branches) has gone away? They'll only be there if you've taken deliberate
 steps to make sure they are.

 So can we just load them? Do we still need the setting? Do we need the
 warning around the setting? Could we not now revert
 
[https://github.com/django/django/commit/51673c146e48ff6230eace39bac18fd555607bee
 51673c14], which was Andrew's commit restricting the search to just `.py`
 files?

 Assuming we don't want to revert, I'm inclined to call this Ready for
 checkin.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.7c39500bfe31bbaf67688edc2157324e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-02-21 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Dan Watson):

 It's true that by default, pyc files are compiled into `__pycache__`
 directories, but there are explicit affordances made to import pyc files
 that exist **in place of** the original py file. See
 https://www.python.org/dev/peps/pep-3147/#case-4-legacy-pyc-files-and-
 source-less-imports

 This is the case for frozen or sourceless distributions. There are
 switches in `compileall` to output legacy pyc files for this purpose (and
 in fact this is what the unit test does). Whether frozen or sourceless
 distributions are a good idea is a much more subjective and (seemingly)
 controversial issue, but they are still possible, and this is how.

 This setting is pretty narrow in scope, just to allow frozen distributions
 (and is off by default with a warning in the docs about the problems it
 may cause).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.c0c9f33cea5f806cd0d37ba593550edf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-02-21 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Andrew Godwin):

 Well, the problem we have these days is that there are no longer any .pyc
 files in the migrations directory (they go into __pycache__) in Python 3 -
 your patch does not seem to address this, so it'll never work unless
 people manually move them into place.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.cc1cc657682d751c76d7ed2fd69821c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-02-21 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Dan Watson):

 * cc: Dan Watson (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.b328d0bfa57d813b6e656d3057e26153%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2018-02-21 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  Dan
 |  Watson
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Dan Watson):

 * owner:  nobody => Dan Watson
 * status:  new => assigned
 * has_patch:  0 => 1


Comment:

 Reviving this ticket a little bit. I think something like this can be
 useful in container environments, where you can guarantee pyc files are
 generated with the same python binary being used to run them, mitigating
 most of the drawbacks listed in
 https://www.curiousefficiency.org/posts/2011/04/benefits-and-limitations-
 of-pyc-only.html (an oldie but a goodie).

 Created a pull request for a new `MIGRATIONS_INCLUDE_PYC` setting,
 complete with docs and tests:

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

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.5980ff32a718a91f024aae1fc4fc691f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2017-03-06 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  Daniel Menzel|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Dylan Young):

 While I don't agree with the conclusion here (migration files *are*
 explicitly imported when you run migrate; leftover .pyc files are a
 tooling problem... think post checkout hooks), if this is the route to go
 (and it's probably wise to do this anyways for other use-cases), I would
 suggest that the setting to control this behaviour simply be
 MIGRATION_LOADERS (as opposed to a tuple of extensions to support, for
 example) and supply default loaders (.py, .pyc, archive) with hooks for
 subclassing/creating new migration loaders. The setting would be a
 tuple/list and the loaders would be consulted in list order (avoids the
 need to mixin for every extension you want to support). This would also
 allow things like a network loader for example.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.15ab5ba7931f7e8aa89da58a6ca78d64%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2015-02-01 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by carljm):

 I understand the use case. (I would guess that none of your other six
 dependencies have a situation with similar constraints to Django migration
 files). As I said before, I'm in favor of a patch that would change your
 case from "Django needs patching" to "Django needs a non-default
 flag/setting." That's why this ticket is in Accepted state. It's just
 waiting for a patch that implements it as a non-default option.

 I also agree with Shai that a setting is more appropriate than a flag,
 because this is a property of a deployment, not a particular invocation.

 (There remains an open question about zipfiles, I guess. I have no problem
 with supporting zip-import by default, but I'm not sure if it's possible
 to do that without also supporting `.pyc` by default, which is
 problematic.)

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.8cc98972f8452280e65a8847e3d054f0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2015-02-01 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by jdetaeye):

 Fair enough, I understand the arguments.

 My use case is somewhat different. I'm packaging my product with py2exe as
 an easy-to-install application (especially for Windows users).  Out of the
 7 python packages it needs, only Django needs patching to behave nicely in
 a frozen zip-file...

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.b5c5dddc8be7c9954f5b4ab35559da3e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2015-01-29 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by aaugustin):

 I agree with Carl.

 Arguments along the lines of "it's the user's problem" are a red flag when
 the problem is likely to affect the vast majority of users — in this case,
 everyone who uses a VCS and doesn't have `PYTHONDONTWRITEBYTECODE` set.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.fefcbf0bf88c982e315eec9d93a36847%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2015-01-29 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by carljm):

 Replying to [comment:14 jdetaeye]:
 > IMHO, a migration is a python package just like any other, and should be
 treated as such.

 It's not a package like any other, because normal Python packages don't
 have an effect on the system unless explicitly imported.

 > If some development practices have an issue with that it's their problem
 - not django's.

 Your patch will cause serious, difficult to debug problems for any
 development practice which involves adding and removing Python modules
 (including migrations) from source code under local development, while
 ignoring `pyc` files. (I know this is the case, because for a period of
 time in the 1.7 development process, orphan `pyc` files were loaded as
 migrations, and it did cause these problems.) I think you would be hard
 pressed to find any current common Django development process that doesn't
 fit that description.

 If you have a practical proposal for how to address that problem (whether
 with documentation changes or otherwise) in your patch, I'm interested in
 discussing it. If you think it's "not Django's problem" and can be
 ignored, I'm afraid we just disagree, and I have to remain -1 on merging
 your patch.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.7ba16928d444c19093537166d1b0139f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2015-01-29 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by jdetaeye):

 For what it's worth, a patch is attached for this issue. It allows
 migrations in any package format to be picked up, be it zip, egg, file,
 ...

 > I think the practical hassles that causes to daily development with e.g.
 git branches outweigh the purity of using the proper Python API for module
 discovery."
 I don't agree with this comment.
 IMHO, a migration is a python package just like any other, and should be
 treated as such.If some development practices have an issue with that it's
 their problem - not django's.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.9c21e680c9bc8a96d3da61186005a9c3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2015-01-28 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by carljm):

 I'm not sure the fix for #8280 is actually appropriate here - I don't
 believe that by default orphan `.pyc` files should be considered as
 present migrations. I think the practical hassles that causes to daily
 development with e.g. git branches outweigh the purity of using the proper
 Python API for module discovery.

 The distinction here is that usually the presence or absence of a module
 that hasn't been explicitly requested doesn't fundamentally alter the
 behavior of the system. With management commands, it does a bit (they'll
 show up in help) but not in a way that's likely to break anything. Here,
 having extra migrations around that shouldn't be around in this branch
 seriously breaks things.

 If we made migrations discover `.pyc` by default, we would basically have
 to document that `PYTHONDONTWRITEBYTECODE=1` is required for effective
 local development in Django.

 I'm not opposed to an option to enable `.pyc` discovery, but I am opposed
 to making it the default.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.f569bf18e99e768b24cb654999826b29%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2015-01-28 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by jdetaeye):

 The Django commands had the same issue:  The code scanned for files in the
 folder with a certain extension, rather than using the proper Python API
 to peek inside the contents of the package.
 Please have a look at ticket #8280 and its resolution.

 6(!) years after reporting, this got fixed. And history repeats itself now
 with the migrations...

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.e89303da02055e963e274f8f941052f9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-12-29 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by andreydani):

 I agree a setting for the file extension would be better.

 I would like to use *.pyc on production (frozen) environments, but not
 when developing or testing.

 I have also made a small '''os.listdir''' replacement that searches for
 modules inside zip files.

 {{{
 def listdir(path):
 if not os.path.isdir(path):
 pos = path.lower().find('.zip')
 if pos >= 0:
 pos += 4
 zip = path[:pos]
 path_within = path[pos + 1:].replace('\\', '/')
 from zipfile import ZipFile
 zip = ZipFile(zip)
 return [a[len(path_within)+1:] for a in zip.namelist() if
 a.startswith(path_within)]
 return os.listdir(path)
 }}}

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.3a4bcb9f852252132657051a8c8ce025%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-10-10 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by shaib):

 Yeah, the idea to add an app was mostly a way to do this in settings.py
 without introducing a new setting.

 So I take that back. But the main point remains: The determination of how
 migrations are found is a property of the deployment, not a property of a
 single invocation of migration commands. A setting is much better than a
 flag.

 On a related note, the setting should probably be more general than just
 "use .pyc's". What about finding migrations in zip files? I can come up
 with a couple of less likely candidates as well.

 So yes, scratch the app overriding the commands. We need a setting to
 specify the path to a migration loader, and we probably need to ship,
 along with the standard loader, one which picks up .pyc files (and maybe
 one which peeks in archives).

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.9e705daae23eed1a142e3d6fb3c34690%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-07 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by thedrow):

 +1 for --pyc. I think it's a good idea.
 Having to extend anything in the code in order to migrate on frozen
 environments seems like a bit too much work.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.5424e8d21e8fefaa6598b3292e57f2c9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-05 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by andrewgodwin):

 Well, there's definitely a call here to have the underlying implementation
 (i.e. `MigrationLoader`) take a list of extensions to allow, and then I
 think we may as well go the extra leg and add a --pyc flag; I'd hate to
 have people have to override the entire command just to get this
 behaviour.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.b2360f38bbc65e20b8e76b5d0e3387e6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-03 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by shaib):

 I think migrate and sqlmigrate are the only required ones for the use-case
 (you don't generate or manipulate migrations in a frozen environment).

 But I don't like the flag approach -- it essentially passes the problem
 from the developer to their user.

 I think the correct approach is an app that overrides ("enhances", if you
 like) the built-in migration commands, in much the same way that South
 enhanced `syncdb`. If it is hard to write as a 3rd-party app, we should
 make the changes required to make it easy.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.7dbf4d7c29473ac2205d68d3602ed349%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-03 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by andrewgodwin):

 If it was to work correctly, it would need to be passed to
 `makemigrations`, `migrate`, `sqlmigrate` and `squashmigrations`, but I
 suspect we could get away with just adding it to `migrate` and
 `sqlmigrate`? I'm still not sure about that, but seems better than a
 setting.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.790e31acae7551f85ab8224f57304d16%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-03 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by danielmenzel):

 Or perhaps add the list of searched extensions as a class attribute, so
 that monkey-patching is made easier?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.3fcac7e247ae014fd9ace1917698f962%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-03 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by bmispelon):

 Can't we get away with an option passed to the command (something like
 `--pyc`)?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.037f71b0222ccd3004d2ee2a819864d7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-03 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by andrewgodwin):

 Well, we'd have to introduce a setting if we wanted to make this work (a
 la SOUTH_INCLUDE_PYC), and I'm somewhat averse to adding more settings
 than necessary. We definitely can't change the default behaviour back;
 people were seeing all sorts of bugs when switching branches due to .pyc
 files.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.121e8791441bfdea75f5e198b7e22636%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-03 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by carljm):

 The reason for the change was because treating an orphan `.pyc` as a real
 migration causes too many problems with things like switching branches in
 git.

 I think not looking for `.pyc` files is the right default behavior, but I
 wouldn't have any problem with some form of configurability to support
 things like cx_Freeze.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.bd84121334228860d55938ef68968f16%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-03 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:  danielmenzel |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  migrations, .pyc,| Triage Stage:  Accepted
  frozen, cx_Freeze  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by timgraham):

 * cc: andrewgodwin (added)
 * needs_docs:   => 0
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 I forget the reasoning, but I believe the decision was not to support
 frozen environments. We should at least document this.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.f040ee59b721c0650763a151358deddc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #23406: Migrations not found when only .pyc files are available (e.g. in a frozen environment)

2014-09-03 Thread Django
#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-+-
 Reporter:   |  Owner:  nobody
  danielmenzel   | Status:  new
 Type:  Bug  |Version:  1.7
Component:   |   Keywords:  migrations, .pyc, frozen, cx_Freeze
  Migrations |  Has patch:  0
 Severity:  Normal   |  UI/UX:  0
 Triage Stage:   |
  Unreviewed |
Easy pickings:  0|
-+-
 == Description ==

 When only '''.pyc''' files are available, for example in a frozen
 environment after running ''cx_Freeze'' or similar tools, migrations no
 longer work: the migrate command does not find any migrations to apply,
 and produces the following output:

 {{{
 Operations to perform:
   Synchronize unmigrated apps: 
   Apply all migrations: (none)
 Synchronizing apps without migrations:
   Creating tables...
 Creating table 
   Installing custom SQL...
   Installing indexes...
 Running migrations:
   No migrations to apply.
   Your models have changes that are not yet reflected in a migration, and
 so won't be applied.
   Run 'manage.py makemigrations' to make new migrations, and then re-run
 'manage.py migrate' to apply them.
 }}}

 Subsequent operations then fail because the database is unmigrated.

 The typical content of a frozen migrations folder looks like this:

 {{{
 django
   contrib
 contenttypes
   migrations
 __init__.pyc
 0001_initial.pyc
 }}}


 == Analysis ==

 Due to issue [https://code.djangoproject.com/ticket/23237], there was a
 change in django.db.migrations.loader
 
([https://code.djangoproject.com/changeset/267630ad50c69ebfe594de37a0636264aa5be7d6]):
 Previously, migrations were found if they had a '''.py''', '''.pyc''', or
 '''.pyo''' extension. Now only migrations with '''.py''' extensions are
 found.

 Perhaps it would be possible to add a check if Django is running in a
 frozen environment:

 {{{
 if hasattr(sys, 'frozen'):
 extensions = ('.py', '.pyc')
 else:
 extensions = ('.py', )
 ...
 if name.endswith(extensions):
 ...
 }}}

 or make the list of allowed extensions configurable by the user.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/055.7cd655e2c3bf63b7339739759b89274c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.