maxtepkeev / architect

A set of tools which enhances ORMs written in Python with more features
Other
391 stars 57 forks source link

How to check if your ORM is supported! (Django + others) #71

Closed Andrew-Chen-Wang closed 3 years ago

Andrew-Chen-Wang commented 4 years ago

I'm not affiliated to @maxtepkeev, but I ran the travis tests for Django on all supported versions and ALL except for Python 3.4 with MySQL (PostgreSQL works fine) work fine. I recommend you just get Travis from GitHub's market, create your own repository, and debug from there by testing everything on your repository and copying the files to your Django app. For EVERYONE though, your .travis.yml should NOW include:

dist: xenial
services:
    - postgresql
    - mysql
...
install:
  - travis_retry pip install -r tests/requirements.txt
  - travis_retry pip install coveralls psycopg2 mysqlclient
...

I changed PyMySQL to mysqlclient since Django kept raising that error (I only tested on Django). Additionally, with my other repository, Django-cachalot, there seems to be this consistent error with Python 3.4 and MySQL so you should avoid it in general. You should be able to figure out how travis's files work. For other Djangonauts, this is my travis config file:

dist: xenial
services:
  - postgresql
  - mysql
sudo: false
language: python
python:
  - 2.7
  - 3.4
  - 3.5
  - 3.6
  - 3.7
  - 3.8
env:
  - DJANGO='django>=1.11.0,<1.12.0' DB='all'
  - DJANGO='django>=2.0.0,<2.1.0' DB='all'
  - DJANGO='django>=2.1.0,<2.2.0' DB='all'
  - DJANGO='django>=2.2.0,<3.0.0' DB='all'
  - DJANGO='django>=3.0.0,<3.1.0' DB='all'
matrix:
  fast_finish: true
  exclude:
    - python: 2.7
      env: DJANGO='django>=2.0.0,<2.1.0' DB='all'
    - python: 2.7
      env: DJANGO='django>=2.1.0,<2.2.0' DB='all'
    - python: 2.7
      env: DJANGO='django>=2.2.0,<3.0.0' DB='all'
    - python: 2.7
      env: DJANGO='django>=3.0.0,<3.1.0' DB='all'
    - python: 3.4
      env: DJANGO='django>=2.1.0,<2.2.0' DB='all'
    - python: 3.4
      env: DJANGO='django>=2.2.0,<3.0.0' DB='all'
    - python: 3.4
      env: DJANGO='django>=3.0.0,<3.1.0' DB='all'
    - python: 3.5
      env: DJANGO='django>=3.0.0,<3.1.0' DB='all'
    - python: 3.8
      env: DJANGO='django>=1.11.0,<1.12.0' DB='all'
before_script:
  - psql -c 'create database architect;' -U postgres
  - mysql -e 'create database architect;' -u root
install:
  - travis_retry pip install -r tests/requirements.txt
  - travis_retry pip install coveralls psycopg2 mysqlclient
  - if [[ $DJANGO ]]; then travis_retry pip install $DJANGO; fi
script:
  - nosetests --with-coverage --cover-erase --cover-package=architect
after_success:
  - coveralls

Again they all worked fine except for python 3.4 with MySQL: IMG_2330 IMG_2331

maxtepkeev commented 3 years ago

0.6.0 added support for all latest ORM versions as well as latest Python versions.