Re: guardian and django1.7

2014-08-25 Thread Brian May
Ok, managed to get guardian tests working with Django 1.7

Patches 0004 to 0010 available at:

https://github.com/brianmay/django-guardian/tree/master/debian/patches

Not sure if this is suitable for a NMU to Debian; I just made it work as
opposed to trying to work out the best solution for some of the problems.
e.g.

https://github.com/brianmay/django-guardian/blob/master/debian/patches/0008-Fix-conflicting-related_name.patch
-- 
Brian May 


Re: guardian and django1.7

2014-08-25 Thread Brian May
On 25 August 2014 15:50, Brian May  wrote:

> At the moment, am wondering if maybe this is a Django 1.7 bug.
>

Unless I hear otherwise, I am going to assume this is a Django 1.7 bug:

https://code.djangoproject.com/ticket/23360
-- 
Brian May 


Re: guardian and django1.7

2014-08-24 Thread Brian May
As an experiment, I imported django-guardian from the *.dsc files to git
using git-dpm, and applied my changes. Not sure if I have got this right,
it was the first time I used git-dpm.

The result is currently at:
https://github.com/brianmay/django-guardian/tree/patched (patched branch).
This is temporary only, as I am not the maintainer for this package.

This fixes some of the easy Django 1.7 issues, however, I am still stuck on
the CircularDependencyError mentioned above.

At the moment, am wondering if maybe this is a Django 1.7 bug.


Re: guardian and django1.7

2014-08-21 Thread Brian May
On 19 August 2014 18:37, Brian May  wrote:

> At which point I ran out of time :-)
>

Ok, did all that. guardian does some "creative" things, am surprised it
works under any version of Django. e.g. defining conflicting DB models, and
only use one of them.

Next error:

Traceback (most recent call last):
  File "setup.py", line 54, in 
**extra_kwargs
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line
137, in run
self.with_project_on_sys_path(self.run_tests)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line
117, in with_project_on_sys_path
func()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line
146, in run_tests
testLoader = loader_class()
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
self.createTests()
  File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
self.module)
  File "/usr/lib/python2.7/unittest/loader.py", line 128, in
loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 113, in
loadTestsFromName
test = obj()
  File
"/home/brian/tree/debian/unstable/django-guardian/django-guardian-1.2.4/tests.py",
line 46, in main
failures = run_tests(settings)
  File
"/home/brian/tree/debian/unstable/django-guardian/django-guardian-1.2.4/tests.py",
line 42, in run_tests
failures = test_runner.run_tests(['auth', 'guardian', 'testapp'])
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 147,
in run_tests
old_config = self.setup_databases()
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 109,
in setup_databases
return setup_databases(self.verbosity, self.interactive, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 299,
in setup_databases
serialize=connection.settings_dict.get("TEST_SERIALIZE", True),
  File "/usr/lib/python2.7/dist-packages/django/db/backends/creation.py",
line 374, in create_test_db
test_flush=True,
  File
"/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line
115, in call_command
return klass.execute(*args, **defaults)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py",
line 337, in execute
output = self.handle(*args, **options)
  File
"/usr/lib/python2.7/dist-packages/django/core/management/commands/migrate.py",
line 106, in handle
plan = executor.migration_plan(targets)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py",
line 49, in migration_plan
for migration in self.loader.graph.forwards_plan(target):
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/graph.py",
line 55, in forwards_plan
return self.dfs(node, lambda x: self.dependencies.get(x, set()))
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/graph.py",
line 121, in dfs
return _dfs(start, get_children, [])
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/graph.py",
line 113, in _dfs
results = _dfs(n, get_children, path) + results
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/graph.py",
line 113, in _dfs
results = _dfs(n, get_children, path) + results
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/graph.py",
line 105, in _dfs
raise CircularDependencyError(path[path.index(start):] + [start])
django.db.migrations.graph.CircularDependencyError: [('admin',
u'0001_initial'), ('testapp', u'0001_initial'), (u'admin', u'0001_initial')]


I have a bad feeling about this.

AFAIK admin == django.contrib.admin, not sure why it says it depends on
testapp. Might be related to this inside testapp/migrations/0001_initial.py
(django1.7 migration, not south):

dependencies = [
('auth', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('admin', '0001_initial'),
]


AUTH_USER_MODEL="testapp.CustomUser", where  testapp/models.py has a
CustomUser class that is based on AbstractUser. Have a suspicion this might
be somehow involved.

Am falling asleep, will leave this now.
-- 
Brian May 


Re: guardian and django1.7

2014-08-20 Thread Brian May
On 19 Aug 2014 18:37, "Brian May"  wrote:
>
> On 19 Aug 2014 18:04, "Raphael Hertzog"  wrote:
> > Did you fill that new directory with an initial migration generated with
> > ./manage.py makemigrations?
>
> Yes, did that, but than I realized I needed to do testapp.
>
> So I did just testapp by itself, but suspect both django apps need to be
done.
>
> At which point I ran out of time :-)

If this works, my concern, if not obvious: to rename the migrations
directories to south_migrations in a debian/patch file will require a patch
to delete every file and another patch to recreate it in the new release.
This will have to be done/rechecked for every release.

Yuck.


Re: guardian and django1.7

2014-08-19 Thread Brian May
On 19 Aug 2014 18:04, "Raphael Hertzog"  wrote:
> Did you fill that new directory with an initial migration generated with
> ./manage.py makemigrations?

Yes, did that, but than I realized I needed to do testapp.

So I did just testapp by itself, but suspect both django apps need to be
done.

At which point I ran out of time :-)


Re: guardian and django1.7

2014-08-19 Thread Raphael Hertzog
Hi,

On Tue, 19 Aug 2014, Brian May wrote:
> > For example, I renamed migrations to south_migrations and created a
> > Django1.7 compliant migrations directory, however still get the same error.

Did you fill that new directory with an initial migration generated with
./manage.py makemigrations?

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

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


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140819080439.ga1...@x230-buxy.home.ouaza.com



Re: guardian and django1.7

2014-08-18 Thread Brian May
On 19 August 2014 11:03, Brian May  wrote:

> Any ideas how to fix
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755598 ?
>
> I have had a fiddle, but not really making any progress (apart from
> Python3 package which works fine).
>
> For example, I renamed migrations to south_migrations and created a
> Django1.7 compliant migrations directory, however still get the same error.
>

I filled this upstream.

https://github.com/lukaszb/django-guardian/issues/255

Have a suspicion this is going to require upstream to fix the problem. I
don't like the idea much of making changes like renaming "migrations" to
"south_migrations" in the Debian packaging.
-- 
Brian May