sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
188 stars 62 forks source link

feat: support for Django 4.2 #159

Closed bellini666 closed 1 year ago

bellini666 commented 1 year ago
bellini666 commented 1 year ago

@sbdchd any idea why the tests failed to install the dependencies? The lockfile is updated correctly

sbdchd commented 1 year ago

@bellini666 thank you for updating everything!

re: the lock file, do you know what poetry version you're running? I'm guessing this repo has a really outdated version vs the one you're running:

WARNING: You are using pip version 21.2.4; however, version 23.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Poetry version 1.1.9
Creating virtualenv django-types in /home/circleci/project/.venv

  RuntimeError

  The lock file is not compatible with the current version of Poetry.
  Upgrade Poetry to be able to read the lock file or, alternatively, regenerate the lock file with the `poetry lock` command.

  at ~/.local/lib/python3.7/site-packages/poetry/packages/locker.py:483 in _get_lock_data
      479│                 "regenerate the lock file with the `poetry lock` command."
      480│             )
      481│         elif not lock_version_allowed:
      482│             raise RuntimeError(
    → 483│                 "The lock file is not compatible with the current version of Poetry.\n"
      484│                 "Upgrade Poetry to be able to read the lock file or, alternatively, "
      485│                 "regenerate the lock file with the `poetry lock` command."
      486│             )
      487│ 

Exited with code exit status 1
bellini666 commented 1 year ago

@sbdchd

re: the lock file, do you know what poetry version you're running? I'm guessing this repo has a really outdated version vs the one you're running:

I'm using the latest poetry version and my pip is also in the latest version.

I tried updating poetry and keep it uncapped (newer versions should be compatible with older lockfiles, so it is better to keep uncapped IMO, but I can cap it if you prefer). I also changed to python 3.8 instead of 3.7 (3.7 will EOL in a couple of months)

Still it seems that circleci is not using those versions. In this run I can see that it reported that poetry version was still an older one and also gave the same WARNING: You are using pip version 21.2.4; however, version 23.0.1 is available. just after it upgraded pip.

I don't know much of circleci (I usually run tests on github workflows). Am I missing something here?

sbdchd commented 1 year ago

I've replaced Circle with GitHub Actions, hopefully that avoids the poetry version nonsense

bellini666 commented 1 year ago

I've replaced Circle with GitHub Actions, hopefully that avoids the poetry version nonsense

Oh, that's awesome! Ok, updating my PR here

sbdchd commented 1 year ago

hmm not sure why GitHub Actions aren't running 🤔

https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks

bellini666 commented 1 year ago

hmm not sure why GitHub Actions aren't running thinking

https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks

Maybe change to:

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

push I think only runs when you push to a branch in the repository itself, and the PR code is in the fork's repository

bellini666 commented 1 year ago

@sbdchd I changed it in this PR and it is running now

bellini666 commented 1 year ago

@sbdchd btw, I took the liberty of adjusting the tests file and modernize it with the current recommended way of installing dependencies managed by poetry. It seems that the tests worked fine now :)

Btw, what do you think about setting an auto release for PR merge events? There are a lot of actions that can do that automatically, and it can use the PRs title if done using conventional commits (e.g. this is a feat) to increase the major/minor/patch versions automatically

sbdchd commented 1 year ago

Yeah auto release for merge makes a ton of sense!