Migrate from setup.py and setup.cfg to pyproject.toml

This commit is contained in:
David Wobrock authored and David Wobrock committed 2023-10-29 10:56:37 +01:00
1 parent b1f1dd68bb
commit 0320cf10dd
25 files changed
+85 -85

No files matched your search

+6
View File
@@ -1,3 +1,9 @@
## 5.x.y
Miscellaneous:
- Migrated from `setup.py` and `setup.cfg` to `pyproject.toml`
## 5.0.0 ## 5.0.0
- **Breaking change**: stop silently ignoring when the internal `sqlmigrate` call fails and the linter cannot analyse the migration. - **Breaking change**: stop silently ignoring when the internal `sqlmigrate` call fails and the linter cannot analyse the migration.
+2
View File
@@ -1,6 +1,8 @@
prune tests
include README.md include README.md
include LICENSE include LICENSE
include CHANGELOG.md include CHANGELOG.md
include MANIFEST.in include MANIFEST.in
recursive-include docs * recursive-include docs *
include tox.ini include tox.ini
include pyproject.toml
+4 -3
View File
@@ -2,7 +2,8 @@
A small note on how the linter is usually published to PyPi: A small note on how the linter is usually published to PyPi:
- `rm -r django_migration_linter.egg-info/` - `rm -r django_migration_linter.egg-info/ dist/`
- `pip install wheel twine` - `pip install --upgrade build`
- `python3 setup.py sdist bdist_wheel --universal` - `python -m build`
- `pip install --upgrade twine`
- `twine upload dist/django_migration_linter-X.Y.Z-py3-none-any.whl dist/django-migration-linter-X.Y.Z.tar.gz` - `twine upload dist/django_migration_linter-X.Y.Z-py3-none-any.whl dist/django-migration-linter-X.Y.Z.tar.gz`
+1 -1
View File
@@ -92,7 +92,7 @@ You can also ignore backward incompatible migration tests by adding this option
`python manage.py lintmigrations --exclude-migration-tests ALTER_COLUMN` `python manage.py lintmigrations --exclude-migration-tests ALTER_COLUMN`
The migration test codes can be found in the [corresponding source code files](../django_migration_linter/sql_analyser/base.py). The migration test codes can be found in the [corresponding source code files](../src/django_migration_linter/sql_analyser/base.py).
## Production usage example ## Production usage example
+68
View File
@@ -0,0 +1,68 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "django-migration-linter"
version = "5.0.0"
description = "Detect backward incompatible migrations for your django project"
authors = [
{ name="3YOURMIND GmbH", email="fb@3yourmind.com" },
]
maintainers = [{name = "David Wobrock", email = "david.wobrock@gmail.com"}]
readme = "README.md"
requires-python = ">=3.7"
dependencies = [
"django>=2.2",
"appdirs>=1.4.3",
"toml>=0.10.2",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
keywords = [
"django",
"migration",
"lint",
"linter",
"database",
"backward",
"compatibility",
]
[project.urls]
Changelog = "https://github.com/3YOURMIND/django-migration-linter/blob/main/CHANGELOG.md"
Repository = "https://github.com/3YOURMIND/django-migration-linter"
[project.optional-dependencies]
test = [
"tox>=4.6.3",
"mysqlclient>=2.1.1",
"psycopg2>=2.9.6",
"django_add_default_value>=0.4.0",
"coverage>=7.2.7",
]
[tool.isort]
multi_line_output = 3
include_trailing_comma = "True"
force_grid_wrap = 0
use_parentheses = "True"
ensure_newline_before_comments = "True"
line_length = 88
add_imports = [ "from __future__ import annotations" ]
-13
View File
@@ -1,13 +0,0 @@
[isort]
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
ensure_newline_before_comments = True
line_length = 88
add_imports =
from __future__ import annotations
[flake8]
max-line-length=88
ignore=E203,W503
-68
View File
@@ -1,68 +0,0 @@
from __future__ import annotations
import ast
import re
from os import path
from setuptools import find_packages, setup
PROJECT_DIR = path.abspath(path.dirname(__file__))
def get_version():
constants = path.join(PROJECT_DIR, "django_migration_linter", "constants.py")
_version_re = re.compile(r"__version__\s+=\s+(?P<version>.*)")
with open(constants) as f:
match = _version_re.search(f.read())
version = match.group("version") if match is not None else '"unknown"'
return str(ast.literal_eval(version))
with open(path.join(PROJECT_DIR, "README.md")) as f:
long_description = f.read()
setup(
name="django-migration-linter",
version=get_version(),
description="Detect backward incompatible migrations for your django project",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/3YOURMIND/django-migration-linter",
author="3YOURMIND GmbH",
author_email="david.wobrock@gmail.com",
license="Apache License 2.0",
packages=find_packages(include=["django_migration_linter*"]),
install_requires=[
"django>=2.2",
"appdirs>=1.4.3",
"toml>=0.10.2",
],
extras_require={
"test": [
"tox>=4.6.3",
"mysqlclient>=2.1.1",
"psycopg2>=2.9.6",
"django_add_default_value>=0.4.0",
"coverage>=7.2.7",
],
},
keywords="django migration lint linter database backward compatibility",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4
View File
@@ -38,3 +38,7 @@ commands =
coverage xml -i coverage xml -i
extras = test extras = test
pip_pre = true pip_pre = true
[flake8]
max-line-length=88
ignore=E203,W503