Skip to content

Commit

Permalink
ruff check; other little fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeliza committed Dec 7, 2024
1 parent edcb747 commit db2f1e3
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 25 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lab-inventory is licensed for you to use under the BSD 3-Clause License. See COP

### Quick start

1. Requires Python 3.10+ and Django 4.2+
1. Requires Python 3.10+. Runs on Django 4.2 LTS and 5.1.

1. Install the package from pypi: `pip install django-lab-inventory`. Worth putting in a virtualenv.

Expand Down Expand Up @@ -41,4 +41,4 @@ Recommend using [uv](https://docs.astral.sh/uv/) for development.

Run `uv sync` to create a virtual environment and install dependencies. `uv sync --no-dev --frozen` for deployment.

Testing: `uv run pytest`. This uses settings from `test/settings.py`
Testing: `uv run pytest`. Requires a test database, will use settings from `inventory/test/settings.py`.
2 changes: 1 addition & 1 deletion inventory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
# -*- mode: python -*-
__version__ = "0.5.4"
__version__ = "0.5.5"
3 changes: 2 additions & 1 deletion inventory/forms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# -*- mode: python -*-
import datetime

from django import forms
from django.contrib.auth.models import User

from inventory.models import Account, Order, Vendor, Item, OrderItem
from inventory.models import Account, Item, Order, OrderItem, Vendor


class NewOrderForm(forms.ModelForm):
Expand Down
5 changes: 3 additions & 2 deletions inventory/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings
import datetime

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import datetime

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion inventory/migrations/0002_auto_20150626_1805.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion inventory/migrations/0002_auto_20170623_1716.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Generated by Django 1.11.2 on 2017-06-23 21:16
from __future__ import unicode_literals

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion inventory/migrations/0003_auto_20150626_1807.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion inventory/migrations/0007_remove_duplicates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by Django 4.1.5 on 2023-07-21 18:17
from django.db.models import Count
from django.db import migrations
from django.db.models import Count


def purge_duplicate_named(apps, schema_editor):
Expand Down
5 changes: 3 additions & 2 deletions inventory/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- mode: python -*-

import pytest

from django.contrib.auth import get_user_model
from inventory.models import Item, Order, OrderItem, Vendor, Unit, Category, Account

from inventory.models import Account, Category, Item, Order, OrderItem, Unit, Vendor


def get_sentinel_user():
return get_user_model().objects.get_or_create(username="deleted")[0]
Expand Down
3 changes: 1 addition & 2 deletions inventory/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- mode: python -*-

import pytest


def test_dummy():
return True
pass
1 change: 0 additions & 1 deletion inventory/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django.urls import path

# If you have no specific test URLs, you can use an empty list
urlpatterns = []
8 changes: 4 additions & 4 deletions inventory/views.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# -*- coding: utf-8 -*-
# -*- mode: python -*-
from django.shortcuts import get_object_or_404, redirect
import django_filters as filters
from django.db.models import Q
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.views import generic
from django_filters.views import FilterView

from inventory.models import Item, Order, OrderItem
from inventory.forms import (
NewOrderForm,
ConfirmOrderForm,
NewItemForm,
NewOrderForm,
NewOrderItemForm,
ConfirmOrderForm,
)
from inventory.models import Item, Order, OrderItem


def index(request):
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ include = '\.pyi?$'
[tool.ruff]
line-length = 88
target-version = "py38"
select = [
lint.select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
]
ignore = ["E221", "E501", "E701"] # Matching your pep8 ignores
lint.ignore = ["E221", "E501", "E701"] # Matching your pep8 ignores

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]

[tool.mypy]
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# -*- mode: python -*-
from setuptools import setup

setup()
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db2f1e3

Please sign in to comment.