-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
179 lines (159 loc) · 4.42 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
[tool.poetry]
name = "glue-utils"
version = "0.8.1"
package-mode = true
description = "Reusable utilities for working with Glue PySpark jobs"
authors = ["Noel Llevares <dashmug@gmail.com>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/dashmug/glue-utils"
repository = "https://github.com/dashmug/glue-utils/issues"
documentation = "https://github.com/dashmug/glue-utils/wiki"
classifiers = [
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
keywords = [
"aws",
"glue",
"pyspark",
"spark",
"etl",
"data",
"data-engineering",
]
[tool.poetry.dependencies]
python = "^3.9"
[tool.poetry.group.dev.dependencies]
bumpver = "^2023.1129"
mypy = "^1.11.2"
pre-commit = "^3.8.0"
ruff = "^0.6.4"
[tool.poetry.group.test.dependencies]
pytest = "^8.3.2"
pytest-cov = "^5.0.0"
pytest-randomly = "^3.15.0"
[tool.poetry.group.local.dependencies]
# The "local" dependency group refers to dependencies that already
# exist in AWS Glue's runtime. We don't need to install these in the
# container. We only need them for local (non-container) development to
# aid the IDE in providing code completion and type checking.
#
# It is best to keep the dependencies here in sync with what's on Glue's
# documentation.
# https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-libraries.html#glue-modules-provided
aws-glue-libs = { git = "https://github.com/awslabs/aws-glue-libs.git", rev = "master" }
pyspark = "3.3.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 88
output-format = "full"
target-version = "py39"
unsafe-fixes = true
show-fixes = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D104",
"D203",
"D213",
# Conflicts with ruff format
"COM812",
"ISC001",
# missing-type-self
"ANN101",
# missing-type-cls
"ANN102",
# line-too-long
"E501",
# Ignore camelCase attributes since Glue uses a lot of them
"N815",
# X | Y syntax does not play well with get_type_hints in Python 3.9
"UP007"
]
# # Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.mccabe]
max-complexity = 5
[tool.ruff.lint.per-file-ignores]
"test/**" = ["S101", "ANN001", "ANN201", "ARG001", "ARG002", "PLR2004", "PLR0913", "D"]
[tool.mypy]
files = "**/*.py"
python_version = "3.9"
show_error_codes = true
pretty = true
strict = true
ignore_missing_imports = true
implicit_reexport = true
explicit_package_bases = true
[[tool.mypy.overrides]]
module = "test.*"
disallow_incomplete_defs = false
disallow_untyped_defs = false
[tool.pytest.ini_options]
testpaths = ["test"]
python_files = ["test_*.py"]
filterwarnings = [
"ignore::FutureWarning:pyspark.sql.context",
"ignore::UserWarning:test.test_options",
]
junit_suite_name = "glue_utils"
[tool.coverage.run]
relative_files = true
branch = true
omit = ["**/test_*.py"]
[tool.coverage.paths]
source = ["src/glue_utils", "*/site-packages/glue_utils"]
[tool.coverage.report]
skip_empty = true
show_missing = true
exclude_also = [
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
"@overload",
]
[tool.coverage.xml]
output = "coverage/results.xml"
[tool.bumpver]
current_version = "0.8.1"
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
commit_message = "release: Bump version {old_version} -> {new_version}"
commit = true
[tool.bumpver.file_patterns]
"pyproject.toml" = [
'current_version = "{version}"',
'version = "{version}"',
]
"README.md" = [
'glue_utils=={version}',
]
"src/glue_utils/__init__.py" = [
'^__version__ = "{version}"$',
]
"sonar-project.properties" = [
'^sonar.projectVersion={version}$',
]
[tool.importlinter]
root_package = "glue_utils"
[[tool.importlinter.contracts]]
name = "Generic code should not import specific code"
type = "layers"
layers = ["glue_utils.pyspark", "glue_utils.options"]