Skip to content

Commit 1d7ce33

Browse files
committed
Update package build tools
1 parent 0f96fb3 commit 1d7ce33

File tree

8 files changed

+96
-94
lines changed

8 files changed

+96
-94
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ charset = utf-8
1111
end_of_line = lf
1212
max_line_length = 88
1313

14-
[*.{json,yml,yaml,js,jsx}]
14+
[*.{json,yml,yaml,js,jsx,toml}]
1515
indent_size = 2
1616

1717
[LICENSE]

.github/workflows/ci.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/setup-python@v3
15-
- run: python -m pip install --upgrade pip setuptools wheel twine readme-renderer
1615
- uses: actions/checkout@v3
17-
- run: python setup.py sdist bdist_wheel
16+
- run: python -m build --sdist --wheel
1817
- run: python -m twine check dist/*
1918

2019
standardjs:
@@ -66,13 +65,11 @@ jobs:
6665
strategy:
6766
matrix:
6867
python-version:
69-
- "3.7"
70-
- "3.8"
7168
- "3.9"
69+
- "3.10"
7270
django-version:
73-
- "2.2"
74-
- "3.1"
7571
- "3.2"
72+
- "4.0"
7673
steps:
7774
- uses: actions/checkout@v3
7875
- name: Set up Python ${{ matrix.python-version }}
@@ -89,12 +86,10 @@ jobs:
8986
mkdir bin
9087
curl -qO "https://chromedriver.storage.googleapis.com/$(curl -q https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip"
9188
unzip chromedriver_linux64.zip -d bin
92-
- name: Upgrade Python setuptools
93-
run: python -m pip install --upgrade pip setuptools wheel codecov
94-
- name: Install Django version ${{ matrix.django-version }}
95-
run: python -m pip install django~=${{ matrix.django-version }}
96-
- name: Run tests
97-
run: PATH=$PATH:$(pwd)/bin python setup.py test
98-
- run: codecov
89+
90+
- run: python -m pip install .[test]
91+
- run: python -m pip install django~=${{ matrix.django-version }}
92+
- run: python -m pyteset
9993
env:
100-
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
94+
PATH: $PATH:$(pwd)/bin
95+
- run: codecov

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var/
2222
*.egg-info/
2323
.installed.cfg
2424
*.egg
25+
_version.py
2526

2627
# PyInstaller
2728
# Usually these files are written by a python script from a template

pyproject.toml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
[project]
2+
name = "django-s3file"
3+
authors = [
4+
{ name = "Johannes Maron", email = "johannes@maron.family" }
5+
]
6+
readme = "README.rst"
7+
license = { file = "LICENSE" }
8+
dynamic = ["version", "description"]
9+
classifiers = [
10+
"Development Status :: 6 - Mature",
11+
"Environment :: Web Environment",
12+
"Intended Audience :: Developers",
13+
"License :: OSI Approved :: MIT License",
14+
"Operating System :: OS Independent",
15+
"Programming Language :: Python",
16+
"Programming Language :: JavaScript",
17+
"Topic :: Software Development",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3 :: Only",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Framework :: Django",
23+
"Framework :: Django :: 3.2",
24+
"Framework :: Django :: 4.0",
25+
]
26+
requires-python = ">=3.9"
27+
dependencies = [
28+
"django>=2.0",
29+
"django-storages",
30+
"boto3",
31+
]
32+
33+
[project.optional-dependencies]
34+
test = [
35+
"pytest >=2.7.3",
36+
"pytest-cov",
37+
"pytest-django",
38+
"selenium",
39+
]
40+
41+
[project.urls]
42+
Project-URL = "https://github.com/codingjoe/django-s3file"
43+
44+
[build-system]
45+
requires = ["flit_core>=3.2", "flit_scm", "wheel"]
46+
build-backend = "flit_scm:buildapi"
47+
48+
[tool.flit.module]
49+
name = "s3file"
50+
51+
[tool.setuptools_scm]
52+
write_to = "s3file/_version.py"
53+
54+
[tool.pytest.ini_options]
55+
minversion = "6.0"
56+
addopts = "--cov=s3file --cov-report xml --tb=short -rxs"
57+
testpaths = [
58+
"tests",
59+
]
60+
DJANGO_SETTINGS_MODULE = "tests.testapp.settings"
61+
62+
[tool.isort]
63+
atomic = true
64+
line_length = 88
65+
known_first_party = "s3file, tests"
66+
include_trailing_comma = true
67+
default_section = "THIRDPARTY"
68+
combine_as_imports = true
69+
70+
[tool.pydocstyle]
71+
add_ignore = "D1"

s3file/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
default_app_config = "s3file.apps.S3FileConfig"
1+
"""A lightweight file uploader input for Django and Amazon S3."""
2+
3+
import django
4+
from . import _version
5+
6+
__version__ = _version.version
7+
VERSION = _version.version_tuple
8+
9+
if django.VERSION < (4, 0):
10+
default_app_config = "s3file.apps.S3FileConfig"

setup.cfg

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,8 @@
1-
[metadata]
2-
name = django-s3file
3-
author = Johannes Hoppe
4-
author_email = info@johanneshoppe.com
5-
description = A lightweight file uploader input for Django and Amazon S3
6-
long_description = file: README.rst
7-
long_description_content_type = text/x-rst
8-
url = https://github.com/codingjoe/django-s3file
9-
license = MIT
10-
license_files = LICENSE
11-
classifier =
12-
Development Status :: 6 - Mature
13-
Environment :: Web Environment
14-
Framework :: Django
15-
Intended Audience :: Developers
16-
License :: OSI Approved :: MIT License
17-
Operating System :: OS Independent
18-
Programming Language :: Python
19-
Programming Language :: JavaScript
20-
Topic :: Software Development
21-
Programming Language :: Python :: 3
22-
Programming Language :: Python :: 3 :: Only
23-
Programming Language :: Python :: 3.6
24-
Programming Language :: Python :: 3.7
25-
Programming Language :: Python :: 3.8
26-
Programming Language :: Python :: 3.9
27-
Framework :: Django
28-
Framework :: Django :: 2.2
29-
Framework :: Django :: 3.1
30-
31-
[options]
32-
include_package_data = True
33-
packages = find:
34-
install_requires =
35-
django>=2.0
36-
django-storages
37-
boto3
38-
setup_requires =
39-
setuptools_scm
40-
pytest-runner
41-
tests_require =
42-
pytest
43-
pytest-cov
44-
pytest-django
45-
selenium
46-
47-
[options.package_data]
48-
* = *.txt, *.rst, *.html, *.po
49-
50-
[options.packages.find]
51-
exclude =
52-
tests
53-
54-
[bdist_wheel]
55-
universal = 1
56-
57-
[aliases]
58-
test = pytest
59-
60-
[tool:pytest]
61-
addopts = --cov=s3file --cov-report xml --tb=short -rxs
62-
DJANGO_SETTINGS_MODULE=tests.testapp.settings
63-
641
[flake8]
652
max-line-length=88
663
select = C,E,F,W,B,B950
674
ignore = E203, E501, W503, E731
685

69-
[pydocstyle]
70-
add_ignore = D1
716

72-
[isort]
73-
atomic = true
74-
line_length = 88
75-
known_first_party = s3file, tests
76-
include_trailing_comma = True
77-
default_section=THIRDPARTY
78-
combine_as_imports = true
7+
8+

setup.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import pytest
55
from django.core.files.base import ContentFile
6-
from django.utils.encoding import force_text
6+
from django.utils.encoding import force_str
77
from selenium import webdriver
88
from selenium.common.exceptions import WebDriverException
99

@@ -15,7 +15,7 @@ def driver():
1515
try:
1616
b = webdriver.Chrome(options=chrome_options)
1717
except WebDriverException as e:
18-
pytest.skip(force_text(e))
18+
pytest.skip(force_str(e))
1919
else:
2020
yield b
2121
b.quit()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy