Skip to content

Commit 27b4c03

Browse files
authored
Merge pull request #236 from ckan/chore_pyproject-toml
chore: switch to pyproject.toml
2 parents d08d61a + b65906c commit 27b4c03

File tree

3 files changed

+146
-92
lines changed

3 files changed

+146
-92
lines changed

pyproject.toml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
[build-system]
2+
requires = [ "setuptools",]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "ckanext-xloader"
7+
version = "1.2.0"
8+
description = "Express Loader - quickly load data into CKAN DataStore"
9+
classifiers = [ "Development Status :: 5 - Production/Stable",
10+
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
11+
"Programming Language :: Python :: 3.7",
12+
"Programming Language :: Python :: 3.8",
13+
"Programming Language :: Python :: 3.9",
14+
"Programming Language :: Python :: 3.10",]
15+
keywords = [ "CKAN", "extension", "datastore",]
16+
dependencies = [ "typing_extensions",]
17+
authors = [
18+
{name = "ThrawnCA", email = "carl.antuar@smartservice.qld.gov.au"},
19+
{name = "Jesse Vickery (JVickery-TBS)", email = "jesse.vickery@tbs-sct.gc.ca"},
20+
{name = "Adrià Mercader (amercader)", email = "amercadero@gmail.com"},
21+
{name = "David Read (davidread)"},
22+
{name = "Brett Jones (kowh-ai)", email = "datashades@linkdigital.com.au"},
23+
{name = "Patricio Del Boca (pdelboca)"},
24+
{name = "William Dutton (duttonw)", email = "william.dutton@qld.gov.au"},
25+
# {name = "", email = ""},
26+
]
27+
maintainers = [
28+
{name = "Adrià Mercader (amercader)", email = "amercadero@gmail.com"},
29+
{name = "William Dutton (duttonw)", email = "william.dutton@qld.gov.au"},
30+
{name = "Ian Ward (wardi)"},
31+
{name = "Brett Jones (kowh-ai)", email = "datashades@linkdigital.com.au"},
32+
]
33+
34+
[project.readme]
35+
file = "README.md"
36+
content-type = "text/markdown"
37+
38+
[project.license]
39+
text = "AGPL"
40+
41+
[project.urls]
42+
Homepage = "https://github.com/ckan/ckanext-xloader"
43+
44+
[project.optional-dependencies]
45+
test = [ "pytest-factoryboy",]
46+
47+
[project.entry-points."ckan.plugins"]
48+
xloader = "ckanext.xloader.plugin:xloaderPlugin"
49+
50+
[project.entry-points."babel.extractors"]
51+
ckan = "ckan.lib.extract:extract_ckan"
52+
53+
[tool.setuptools.packages]
54+
find = {}
55+
56+
[tool.black]
57+
line-length = 79
58+
preview = true
59+
60+
[tool.isort]
61+
known_ckan = "ckan"
62+
known_ckanext = "ckanext"
63+
known_self = "ckanext.xloader"
64+
sections = "FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,CKAN,CKANEXT,SELF,LOCALFOLDER"
65+
66+
[tool.pytest.ini_options]
67+
addopts = "--ckan-ini test.ini"
68+
filterwarnings = [
69+
"ignore::sqlalchemy.exc.SADeprecationWarning",
70+
"ignore::sqlalchemy.exc.SAWarning",
71+
"ignore::DeprecationWarning",
72+
]
73+
74+
[tool.pyright]
75+
pythonVersion = "3.7"
76+
include = ["ckanext"]
77+
exclude = [
78+
"**/test*",
79+
"**/migration",
80+
]
81+
strict = []
82+
83+
strictParameterNoneValue = true # type must be Optional if default value is None
84+
85+
# Check the meaning of rules here
86+
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md
87+
reportFunctionMemberAccess = true # non-standard member accesses for functions
88+
reportMissingImports = true
89+
reportMissingModuleSource = true
90+
reportMissingTypeStubs = false
91+
reportImportCycles = true
92+
reportUnusedImport = true
93+
reportUnusedClass = true
94+
reportUnusedFunction = true
95+
reportUnusedVariable = true
96+
reportDuplicateImport = true
97+
reportOptionalSubscript = true
98+
reportOptionalMemberAccess = true
99+
reportOptionalCall = true
100+
reportOptionalIterable = true
101+
reportOptionalContextManager = true
102+
reportOptionalOperand = true
103+
reportTypedDictNotRequiredAccess = false # We are using Context in a way that conflicts with this check
104+
reportConstantRedefinition = true
105+
reportIncompatibleMethodOverride = true
106+
reportIncompatibleVariableOverride = true
107+
reportOverlappingOverload = true
108+
reportUntypedFunctionDecorator = false
109+
reportUnknownParameterType = true
110+
reportUnknownArgumentType = false
111+
reportUnknownLambdaType = false
112+
reportUnknownMemberType = false
113+
reportMissingTypeArgument = true
114+
reportInvalidTypeVarUse = true
115+
reportCallInDefaultInitializer = true
116+
reportUnknownVariableType = true
117+
reportUntypedBaseClass = true
118+
reportUnnecessaryIsInstance = true
119+
reportUnnecessaryCast = true
120+
reportUnnecessaryComparison = true
121+
reportAssertAlwaysTrue = true
122+
reportSelfClsParameterName = true
123+
reportUnusedCallResult = false # allow function calls for side-effect only (like logic.check_acces)
124+
useLibraryCodeForTypes = true
125+
reportGeneralTypeIssues = true
126+
reportPropertyTypeMismatch = true
127+
reportWildcardImportFromLibrary = true
128+
reportUntypedClassDecorator = false # authenticator relies on repoze.who class-decorator
129+
reportUntypedNamedTuple = true
130+
reportPrivateUsage = true
131+
reportPrivateImportUsage = true
132+
reportInconsistentConstructor = true
133+
reportMissingSuperCall = false
134+
reportUninitializedInstanceVariable = true
135+
reportInvalidStringEscapeSequence = true
136+
reportMissingParameterType = true
137+
reportImplicitStringConcatenation = false
138+
reportUndefinedVariable = true
139+
reportUnboundVariable = true
140+
reportInvalidStubStatement = true
141+
reportIncompleteStub = true
142+
reportUnsupportedDunderAll = true
143+
reportUnusedCoroutine = true
144+
reportUnnecessaryTypeIgnoreComment = true
145+
reportMatchNotExhaustive = true

setup.cfg

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,3 @@ previous = true
1919
domain = ckanext-xloader
2020
directory = ckanext/xloader/i18n
2121
statistics = true
22-
23-
[tool:pytest]
24-
25-
filterwarnings =
26-
ignore::sqlalchemy.exc.SADeprecationWarning
27-
ignore::sqlalchemy.exc.SAWarning
28-
ignore::DeprecationWarning
29-
addopts = --pdbcls=IPython.terminal.debugger:TerminalPdb

setup.py

Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,8 @@
11
# -*- coding: utf-8 -*-
2-
from setuptools import setup, find_packages # Always prefer setuptools over distutils
3-
from codecs import open # To use a consistent encoding
4-
from os import path
2+
from setuptools import setup
53

6-
here = path.abspath(path.dirname(__file__))
7-
8-
# Get the long description from the relevant file
9-
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
10-
long_description = f.read()
114

125
setup(
13-
name='''ckanext-xloader''',
14-
15-
# Versions should comply with PEP440. For a discussion on single-sourcing
16-
# the version across setup.py and the project code, see
17-
# http://packaging.python.org/en/latest/tutorial.html#version
18-
version='1.2.0',
19-
20-
description='Express Loader - quickly load data into CKAN DataStore''',
21-
long_description=long_description,
22-
long_description_content_type='text/markdown',
23-
24-
# The project's main homepage.
25-
url='https://github.com/ckan/ckanext-xloader',
26-
27-
# Author details
28-
author='''David Read''',
29-
author_email='''david.read@hackneyworkshop.com''',
30-
31-
# Choose your license
32-
license='AGPL',
33-
34-
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
35-
classifiers=[
36-
'Development Status :: 5 - Production/Stable',
37-
38-
# Pick your license as you wish (should match "license" above)
39-
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
40-
41-
# Specify the Python versions you support here.
42-
'Programming Language :: Python :: 3.7',
43-
'Programming Language :: Python :: 3.8',
44-
'Programming Language :: Python :: 3.9',
45-
'Programming Language :: Python :: 3.10',
46-
],
47-
48-
49-
# What does your project relate to?
50-
keywords='''CKAN extension datastore''',
51-
52-
# You can just specify the packages manually here if your project is
53-
# simple. Or you can use find_packages().
54-
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
55-
namespace_packages=['ckanext'],
56-
57-
install_requires=[
58-
# CKAN extensions should not list dependencies here, but in a separate
59-
# ``requirements.txt`` file.
60-
#
61-
# http://docs.ckan.org/en/latest/extensions/best-practices.html#add-third-party-libraries-to-requirements-txt
62-
],
63-
64-
# If there are data files included in your packages that need to be
65-
# installed, specify them here. If using Python 2.6 or less, then these
66-
# have to be included in MANIFEST.in as well.
67-
include_package_data=True,
68-
package_data={
69-
},
70-
71-
# Although 'package_data' is the preferred approach, in some case you may
72-
# need to place data files outside of your packages.
73-
# see http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files
74-
# In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
75-
data_files=[],
76-
77-
# To provide executable scripts, use entry points in preference to the
78-
# "scripts" keyword. Entry points provide cross-platform support and allow
79-
# pip to create the appropriate form of executable for the target platform.
80-
entry_points='''
81-
[ckan.plugins]
82-
xloader=ckanext.xloader.plugin:xloaderPlugin
83-
84-
[babel.extractors]
85-
ckan = ckan.lib.extract:extract_ckan
86-
87-
''',
88-
896
# If you are changing from the default layout of your extension, you may
907
# have to change the message extractors, you can read more about babel
918
# message extraction at

0 commit comments

Comments
 (0)