Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with Django 4 #68

Open
ntoll opened this issue Feb 28, 2022 · 14 comments
Open

Doesn't work with Django 4 #68

ntoll opened this issue Feb 28, 2022 · 14 comments

Comments

@ntoll
Copy link

ntoll commented Feb 28, 2022

Found this via HN and looks like something I could use for a current project.

However, requirements are hard pinned to specific versions, including not-the-latest version of Django.

Could you perhaps be more forgiving and/or specify minimum versions for the required dependencies?

Thanks - especially those of us who have to use Django4. ;-)

@ntoll
Copy link
Author

ntoll commented Feb 28, 2022

Here's what a Django 4 user sees from within an existing virtual environment:

$ pip install django-garnett
Collecting django-garnett
  Using cached django_garnett-0.4.7-py3-none-any.whl (27 kB)
Collecting django<3.2.0,>=3.1.0
  Using cached Django-3.1.14-py3-none-any.whl (7.8 MB)
Collecting language-data<1.1.0,>=1.0.1
  Using cached language_data-1.0.1-py3-none-any.whl
Collecting langcodes<3.4.0,>=3.3.0
  Using cached langcodes-3.3.0-py3-none-any.whl (181 kB)
Requirement already satisfied: asgiref<4,>=3.2.10 in /home/ntoll/.virtualenvs/codegrades/lib/python3.9/site-packages (from django<3.2.0,>=3.1.0->django-garnett) (3.5.0)
Requirement already satisfied: pytz in /home/ntoll/.virtualenvs/codegrades/lib/python3.9/site-packages (from django<3.2.0,>=3.1.0->django-garnett) (2021.3)
Requirement already satisfied: sqlparse>=0.2.2 in /home/ntoll/.virtualenvs/codegrades/lib/python3.9/site-packages (from django<3.2.0,>=3.1.0->django-garnett) (0.4.2)
Collecting marisa-trie
  Using cached marisa_trie-0.7.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.3 MB)
Requirement already satisfied: setuptools in /home/ntoll/.virtualenvs/codegrades/lib/python3.9/site-packages (from marisa-trie->language-data<1.1.0,>=1.0.1->django-garnett) (60.6.0)
Installing collected packages: marisa-trie, language-data, langcodes, django, django-garnett
  Attempting uninstall: django
    Found existing installation: Django 4.0.2
    Uninstalling Django-4.0.2:
      Successfully uninstalled Django-4.0.2
Successfully installed django-3.1.14 django-garnett-0.4.7 langcodes-3.3.0 language-data-1.0.1 marisa-trie-0.7.7

@LegoStormtroopr
Copy link
Member

Hmm - we're about to do out own shift to Django 4, so let me see what we can do.

@vvarp
Copy link

vvarp commented Mar 28, 2022

Same applies to Django 3.2 - in order to use django-garnett I had to vendorize it, as installing via poetry/pip was always downgrading Django to 3.1

@LegoStormtroopr
Copy link
Member

So I've had a look:

  • Django 4: is going to require testing a bunch of dependencies. First of which is django reversion. Possibly hard to do. Not impossible.
  • Django 3.2: this is done in Add support for dj32 #69

@ZipBrandon
Copy link

@vvarp How's it doing on Django 4 when vendorizing? I cut a fork and am about to duplicate the same effort.

@ZipBrandon
Copy link

I'm still progressing on this. I updated a few dependencies in my fork. I see that Django 4 removed the KeyTransform and KeyTextTransform from jsonb fields, but I added into the package. I have no understanding of what it was doing for django-garnett yet. I think I'm up-and-running but trying to find my language switcher in my admin so I can test that as well.

https://github.com/ZipDeal-LLC/django-garnett/commit/e60d02818351275cb1d721474ebd40a77819675b

@LegoStormtroopr
Copy link
Member

That is a lot of vendoring in of code that Django removed.

Let me see what we can do through the ORM to make that happen.

@ZipBrandon
Copy link

@LegoStormtroopr I appreciate it. FWIW I use it via my fork's hack at the moment and it works splendidly. It obviously isn't the ideal way to execute it but I appreciate you open sourcing your approach to this!

@angvp
Copy link

angvp commented Jun 9, 2022

Hey @ZipBrandon I tried to use your fork, but I'm having no luck with a project that is already in django 4 and using garnett for the first time (when creating the migrations)

@ZipBrandon
Copy link

ZipBrandon commented Jun 10, 2022

@angvp Did you do this? https://github.com/Aristotle-Metadata-Enterprises/django-garnett#data-migrations. That got me the first time. The trick is in the step_1_safe_encode_content and the step_2_safe_prepare_translations

@angvp
Copy link

angvp commented Jun 10, 2022

I did indeed and didn't help in my case

@ZipBrandon
Copy link

@angvp I have recently had to apply it to another migration and my fork does not work either. It's a shame that django-garnett has not been officially updated at this point and feels as if abandoned.

@LegoStormtroopr
Copy link
Member

LegoStormtroopr commented Sep 8, 2022

@ZipBrandon its not abandoned. It's stable and suitable for our commercial purposes. We are doing internal releasing using Garnett and will be upgrading it to support Django 4 within our roadmap.

As others have pointed out, they have been able to fork and update it for their own projects - within the ethos of FOSS.

If PRs are opened we will review them to see if they are suitable and meet with our requirements as maintainers.

If there is specific development you'd like to see done, you are welcome to reach out and discuss a commercial support option.

@angvp
Copy link

angvp commented Sep 9, 2022

Hey there @LegoStormtroopr and Aristotle-Metadata-Enterprises really thanks for this project, @ZipBrandon we ended up forking and picking a different solution (not going to do publicity about it here as this is not the space for that), and while this is a great project it didn't suit our needs, and while I share your "pain" @LegoStormtroopr is right, in my case, I tried several forks of this, and made it run partially, but it was too much work to do while I was building a proof of concept, I gave it a good 2 or 3 days of updating code and stuff to make it work, I'm happy to open a PR here eventually with some of those changes if they are worth for anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants