# Config file for automatic testing at travis-ci.com

language: python
dist: jammy
python:
  - '3.10'
  - '3.9'
  - '3.8'

services:
  - postgresql

addons:
  postgresql: 14
  apt:
    packages:
    - postgresql-14-postgis-3

before_script:
  - psql -U postgres -c "create extension postgis"

env:
  global:
    - TEST_DB_NAME=travis_ci_test
    - TEST_DB_USER=postgres

install: pip install -r requirements/ci.txt

# Command to run tests, e.g. python setup.py test
script:
  - tox

# Assuming you have installed the travis-ci CLI tool, after you
# create the Github repo and add it to Travis, run the
# following command to finish PyPI deployment setup:
# $ travis encrypt --add deploy.password
deploy:
  provider: pypi
  distributions: sdist bdist_wheel
  user: alexhayes
  password:
    secure: PLEASE_REPLACE_ME
  on:
    tags: true
    repo: alexhayes/django-geopostcodes
    python: 3.8


# Config file for automatic testing at travis-ci.com

language: python
dist: jammy
python:
  - '3.10'
  - '3.8'

  # For some reason setuptools fails on Python 3.9 on travis - so turning 3.9 off for now.
  # See https://app.travis-ci.com/github/alexhayes/django-geopostcodes/jobs/584887053#L570
  # See https://github.com/pypa/setuptools/issues/3560
  # See https://github.com/pypa/pip/issues/6264
  # - '3.9'

services:
  - postgresql

addons:
  postgresql: 14
  apt:
    packages:
    - postgresql-14-postgis-3

before_script:
  - psql -U postgres -c "create extension postgis"

env:
  global:
    - TEST_DB_NAME=travis_ci_test
    - TEST_DB_USER=postgres

install: pip install -r requirements/ci.txt

# Command to run tests, e.g. python setup.py test
script:
  - tox

# Assuming you have installed the travis-ci CLI tool, after you
# create the Github repo and add it to Travis, run the
# following command to finish PyPI deployment setup:
# $ travis encrypt --add deploy.password
deploy:
  provider: pypi
  distributions: sdist bdist_wheel
  user: alexhayes
  password:
    secure: PLEASE_REPLACE_ME
  on:
    tags: true
    repo: alexhayes/django-geopostcodes
    python: 3.8


Disable Python 3.9 due to issue with setuptools.
Disable Python 3.9 due to issue with setuptools.
