-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
196 lines (177 loc) · 5.2 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "django-s3-file-field"
description = "A Django library for uploading files directly to AWS S3 or MinIO Storage from HTTP clients."
readme = "README.md"
requires-python = ">=3.8"
license = { text = "Apache 2.0" }
maintainers = [{ name = "Kitware, Inc.", email = "[email protected]" }]
keywords = [
"django",
"django-widget",
"minio",
"s3",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
'Framework :: Django :: 3',
"Framework :: Django :: 3.2",
'Framework :: Django :: 4',
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python",
]
dependencies = [
"django>=3.2",
"djangorestframework",
]
dynamic = ["version"]
[project.urls]
Repository = "https://github.com/girder/django-s3-file-field"
"Bug Reports" = "https://github.com/girder/django-s3-file-field/issues"
[project.entry-points.pytest11]
s3_file_field = "s3_file_field.fixtures"
[project.optional-dependencies]
s3 = [
# 1.14 has some breaking renames which are adopted here
"django-storages[s3]>=1.14",
"boto3",
]
minio = [
# This is the first version which supports minio>=7, so make dependency resolution easier
"django-minio-storage>=0.5",
"minio>=7",
]
pytest = [
# The "fixtures.py" module (containing the "pytest" requirement) is only loaded
# automatically via entry point by consumers who already have "pytest" installed, so
# "pytest" isn't actually a hard requirement.
"pytest",
]
[tool.hatch.build]
only-include = [
"s3_file_field",
]
artifacts = [
"s3_file_field/static",
]
[tool.hatch.build.targets.sdist]
only-include = [
"s3_file_field",
# The builder needs to run again when installing the sdist, although it will no-op
"multi_npm_builder.py",
]
[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder"]
build-function = "multi_npm_builder.multi_npm_builder"
ensured-targets = [
"s3_file_field/static/s3_file_field/widget.js",
"s3_file_field/static/s3_file_field/widget.css",
]
[[tool.hatch.build.hooks.jupyter-builder.build-kwargs.projects]]
build_cmd = "build"
path = "javascript-client"
source_dir = "javascript-client"
build_dir = "javascript-client/dist"
[[tool.hatch.build.hooks.jupyter-builder.build-kwargs.projects]]
build_cmd = "build"
path = "widget"
source_dir = "widget"
build_dir = "s3_file_field/static/s3_file_field"
[tool.hatch.version]
source = "vcs"
[tool.black]
line-length = 100
target-version = ["py38"]
[tool.coverage.run]
source_pkgs = [
"s3_file_field",
]
[tool.coverage.paths]
source = [
"s3_file_field/",
".tox/**/site-packages/s3_file_field/",
]
[tool.django-stubs]
django_settings_module = "test_app.settings"
[tool.isort]
profile = "black"
line_length = 100
# Sort by name, don't cluster "from" vs "import"
force_sort_within_sections = true
# Combines "as" imports on the same line
combine_as_imports = true
# These test utilities are local, but are loaded as absolute imports
known_local_folder = [
"fuzzy",
"test_app",
]
[tool.mypy]
files = [
"s3_file_field",
"tests",
"python-client/s3_file_field_client",
]
show_error_codes = true
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
]
mypy_path = [
"$MYPY_CONFIG_FILE_DIR/stubs",
# Use the same pythonpath for MyPy as for Pytest
"tests",
]
# Don't allow "tests/" to be accidently imported as a namespace package,
# as that allows multiple possible import paths
namespace_packages = false
[[tool.mypy.overrides]]
module = [
"minio_storage.storage",
"storages.backends.s3",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
# Allow test utilities to be imported without adding the root directory to the pythonpath,
# which would cause the local "s3_file_field" module to shadow the install.
pythonpath = ["tests"]
# Configure pythonpath ourselves, not based on manage.py
django_find_project = false
addopts = [
# Test utilies are imported absolutely from the pythonpath,
# so use the Pytest-reccomended "importlib" mode
"--import-mode=importlib",
"--strict-config",
"--strict-markers",
"--showlocals",
"--verbose",
# Disable the entry point loading of "s3_file_field" fixtures, to support coverage.
# See the comment with "pytest_plugins" in "conftest.py" for full details.
"-p", "no:s3_file_field",
"--cov",
]
filterwarnings = [
"error",
# pytest often causes unclosed socket warnings
'ignore:unclosed <socket\.socket:ResourceWarning',
# Django 3.2 emites some deprecation warnings
"ignore::DeprecationWarning:django",
# Python 3.12 deprecrates "datetime.datetime.utcnow"
'ignore:datetime\.datetime\.utcnow:DeprecationWarning:botocore',
'ignore:datetime\.datetime\.utcnow:DeprecationWarning:minio',
]
DJANGO_SETTINGS_MODULE = "test_app.settings"