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

[DEV-103519] Upgrade to Django 4.2. Switch from travis to GHA #66

Merged
merged 21 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run Tests and Linter

on:
pull_request:
branches:
- master
- main

jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8.18, 3.9.18, 3.10.13, 3.11.8]
django-version: [3.2, 4.2]

name: Lint and Test (Python ${{ matrix.python-version }} - Django ${{ matrix.django-version }})

steps:
- uses: actions/checkout@v2
JVenberg marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
JVenberg marked this conversation as resolved.
Show resolved Hide resolved

- name: Install dependencies
run: |
pip install -q Django==${{ matrix.django-version }}
pip install -e .[flake8,tests]

- name: Add current directory to PYTHONPATH
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV

- name: Lint with flake8
run: flake8

- name: Test with pytest
run: pytest
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions setup.cfg

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did we settle on these options?

Copy link
Contributor Author

@JVenberg JVenberg Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not actually sure. I merged in @facundojmaero's PR here and he had changed a few things. I assume it was to either get it to lint with the newer linter version and/or due to the formatting changes he made

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh gotcha. Yeah like the max line length change, for example. Not a huge deal since its just linting.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend you to migrate to ruff and deprecate all isort, flake8, pylint/black etc...

But it is up-to-you, just ruff is blazing fast and making what it should do without issues...

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ lines_after_imports=2
use_parentheses=True

[tool:pytest]
django_find_project = false
DJANGO_SETTINGS_MODULE = test_settings
python_files = test_*.py
django_find_project=false
DJANGO_SETTINGS_MODULE=test_settings
python_files=test_*.py
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@
URL = 'https://github.com/roverdotcom/django-inlinecss'
EMAIL = '[email protected]'
AUTHOR = 'Philip Kimmey'
REQUIRES_PYTHON = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.7'
REQUIRES_PYTHON = '>=3.8'
VERSION = None

# What packages are required for this module to be executed?
REQUIRED = [
'Django>=1.11',
'Django>=3.2',
'pynliner',
'future>=0.16.0',
]

# What packages are required only for tests?
TESTS = [
'mock==2.0.0',
'pytest==4.3.1',
'pytest-django==3.4.8',
'mock==5.1.0',
'pytest==8.0.1',
'pytest-django==4.8.0',
]

# What packages are optional?
EXTRAS = {
'flake8': [
'flake8==3.6.0',
'flake8-isort==2.6.0',
'isort==4.3.4',
'testfixtures==6.3.0',
'flake8==7.0.0',
'flake8-isort==6.1.1',
'isort==5.13.2',
'testfixtures==8.0.0',
],
'tests': TESTS,
}
Expand Down
Loading