Skip to content

Commit

Permalink
Merge pull request #5 from saritasa-nest/feature/migrate-from-setup-c…
Browse files Browse the repository at this point in the history
…fg-to-pyproject

Add support for `pyproject.toml`
  • Loading branch information
yalef committed May 16, 2023
2 parents 4155ebe + 40f726a commit d4bb0e5
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ repos:

- id: package_installation_verify
name: verify package can be installed
entry: python setup.py check
entry: pip install --dry-run .
language: system
pass_filenames: false
types: [ python ]
Expand Down
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
History
=======

0.1.3 (2023-05-15)
------------------
Migrate from ``setup.py`` and ``setup.cfg`` to ``pyproject.toml``

0.1.2 (2023-05-12)
------------------

Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ release: dist ## package and upload a release
twine upload dist/*

dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
python -m build .
ls -l dist

install: clean ## install the package to the active Python's site-packages
python setup.py install
python -m pip install .
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Once you have a copy of the source, you can install it with:

.. code-block:: console
$ python setup.py install
$ make install
.. _Github repo: https://github.com/saritasa-nest/django-import-export-extensions
Expand Down
2 changes: 1 addition & 1 deletion import_export_extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Saritasa"""
__email__ = "pypi@saritasa.com"
__version__ = "0.1.2"
__version__ = "0.1.3"
145 changes: 145 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
authors = [
{name = "Saritasa", email = "pypi@saritasa.com"},
]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
description = "Extend functionality of `django-import-export`"
readme = "README.rst"
license = {file = "LICENSE"}
keywords = ["django_import_export_extensions"]
name = "django_import_export_extensions"
dynamic = ["dependencies", "version"]

[project.urls]
"Homepage" = "https://github.com/saritasa-nest/django-import-export-extensions"
"Bug Tracker" = "https://github.com/saritasa-nest/django-import-export-extensions/issues"

[tool.setuptools.dynamic]
dependencies = {file = "requirements/production.txt"}
version = {attr = "import_export_extensions.__version__"}

[tool.setuptools.packages.find]
include = ["import_export_extensions", "import_export_extensions.*"]

[tool.isort]
line_length = 79
multi_line_output = 3
known_django = "django"
known_drf = "rest_framework"
known_apps = "import_export_extensions"
skip = [
"migrations",
"_tmp,src",
"scripts",
".venv",
"node_modules",
"config",
]
sections = [
"FUTURE",
"STDLIB",
"DJANGO",
"DRF",
"THIRDPARTY",
"FIRSTPARTY",
"APPS",
"LOCALFOLDER",
]
include_trailing_comma = true
default_section = "THIRDPARTY"

[tool.flake8]
ignore = [
# https://www.flake8rules.com/rules/E126.html
"E126",
# https://www.flake8rules.com/rules/W503.html
"W503",
# https://www.flake8rules.com/rules/W504.html
"W504",
# https://github.com/m-burst/flake8-pytest-style/blob/master/docs/rules/PT004.md
"PT004",
# http://www.pydocstyle.org/en/latest/error_codes.html
"D100",
"D106",
"D107",
"D204",
"D301",
]
statistics = true
count = true
max-complexity = 10
pytest-fixture-no-parentheses = true
pytest-parametrize-names-type = "list"
pytest-parametrize-values-type = "list"
pytest-parametrize-values-row-type = "list"
inline-quotes = "double"
docstring-quotes = "double"
docstring-convention = "pep257"
exclude = [
"migrations",
".venv",
"__init__.py",
"docs",
"tests/settings.py",
]

[tool.mypy]
ignore_missing_imports = true
implicit_optional = false

warn_no_return = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
allow_redefinition = false
disallow_any_generics = true
strict_equality = true
strict_optional = true

ignore_errors = false
local_partial_types = true

enable_error_code = [
"truthy-bool",
"redundant-expr",
]

disable_error_code = [
"attr-defined",
"index",
"annotation-unchecked",
]

exclude = "settings.py"

[[tool.mypy.overrides]]
module = "tests.*"
warn_unreachable = false

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "tests.settings"
python_files = [
"tests.py",
"test_*.py",
"*_tests.py",
]
3 changes: 3 additions & 0 deletions requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ flake8-django
# https://github.com/zheller/flake8-quotes
# A flake8 plugin to expect usage of double quotes
flake8-quotes
# A flake8 plugin loading the configuration from pyproject.toml
# https://github.com/john-hen/Flake8-pyproject
flake8-pyproject
# https://flake8.pycqa.org/en/latest/
flake8
# McCabe complexity checker
Expand Down
109 changes: 0 additions & 109 deletions setup.cfg

This file was deleted.

81 changes: 0 additions & 81 deletions setup.py

This file was deleted.

0 comments on commit d4bb0e5

Please sign in to comment.