From 9ae3b5bd7de17f632f6ae98bb8203140a6c81521 Mon Sep 17 00:00:00 2001 From: William Dutton Date: Mon, 25 Nov 2024 08:08:47 +1000 Subject: [PATCH 1/2] chore: switch to pyproject.toml Updated authors --- pyproject.toml | 145 +++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 8 --- setup.py | 85 +---------------------------- 3 files changed, 146 insertions(+), 92 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..bee3c33c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,145 @@ +[build-system] +requires = [ "setuptools",] +build-backend = "setuptools.build_meta" + +[project] +name = "ckanext-xloader" +version = "1.2.0" +description = "Express Loader - quickly load data into CKAN DataStore" +classifiers = [ "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10",] +keywords = [ "CKAN", "extension", "datastore",] +dependencies = [ "typing_extensions",] +authors = [ + {name = "ThrawnCA", email = "carl.antuar@smartservice.qld.gov.au"}, + {name = "Jesse Vickery (JVickery-TBS)", email = "jesse.vickery@tbs-sct.gc.ca"}, + {name = "Adrià Mercader (amercader)", email = "amercadero@gmail.com"}, + {name = "David Read (davidread)"}, + {name = "Brett Jones (kowh-ai)", email = "datashades@linkdigital.com.au"}, + {name = "Patricio Del Boca (pdelboca)", email = "patriciodelboca@gmail.com"}, + {name = "William Dutton (duttonw)", email = "william.dutton@qld.gov.au"}, +# {name = "", email = ""}, +] +maintainers = [ + {name = "Adrià Mercader (amercader)", email = "amercadero@gmail.com"}, + {name = "William Dutton (duttonw)", email = "william.dutton@qld.gov.au"}, + {name = "Ian Ward (wardi)", email = "ian@excess.org"}, + {name = "Brett Jones (kowh-ai)", email = "datashades@linkdigital.com.au"}, +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +text = "AGPL" + +[project.urls] +Homepage = "https://github.com/ckan/ckanext-xloader" + +[project.optional-dependencies] +test = [ "pytest-factoryboy",] + +[project.entry-points."ckan.plugins"] +xloader = "ckanext.xloader.plugin:xloaderPlugin" + +[project.entry-points."babel.extractors"] +ckan = "ckan.lib.extract:extract_ckan" + +[tool.setuptools.packages] +find = {} + +[tool.black] +line-length = 79 +preview = true + +[tool.isort] +known_ckan = "ckan" +known_ckanext = "ckanext" +known_self = "ckanext.xloader" +sections = "FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,CKAN,CKANEXT,SELF,LOCALFOLDER" + +[tool.pytest.ini_options] +addopts = "--ckan-ini test.ini" +filterwarnings = [ + "ignore::sqlalchemy.exc.SADeprecationWarning", + "ignore::sqlalchemy.exc.SAWarning", + "ignore::DeprecationWarning", +] + +[tool.pyright] +pythonVersion = "3.7" +include = ["ckanext"] +exclude = [ + "**/test*", + "**/migration", +] +strict = [] + +strictParameterNoneValue = true # type must be Optional if default value is None + +# Check the meaning of rules here +# https://github.com/microsoft/pyright/blob/main/docs/configuration.md +reportFunctionMemberAccess = true # non-standard member accesses for functions +reportMissingImports = true +reportMissingModuleSource = true +reportMissingTypeStubs = false +reportImportCycles = true +reportUnusedImport = true +reportUnusedClass = true +reportUnusedFunction = true +reportUnusedVariable = true +reportDuplicateImport = true +reportOptionalSubscript = true +reportOptionalMemberAccess = true +reportOptionalCall = true +reportOptionalIterable = true +reportOptionalContextManager = true +reportOptionalOperand = true +reportTypedDictNotRequiredAccess = false # We are using Context in a way that conflicts with this check +reportConstantRedefinition = true +reportIncompatibleMethodOverride = true +reportIncompatibleVariableOverride = true +reportOverlappingOverload = true +reportUntypedFunctionDecorator = false +reportUnknownParameterType = true +reportUnknownArgumentType = false +reportUnknownLambdaType = false +reportUnknownMemberType = false +reportMissingTypeArgument = true +reportInvalidTypeVarUse = true +reportCallInDefaultInitializer = true +reportUnknownVariableType = true +reportUntypedBaseClass = true +reportUnnecessaryIsInstance = true +reportUnnecessaryCast = true +reportUnnecessaryComparison = true +reportAssertAlwaysTrue = true +reportSelfClsParameterName = true +reportUnusedCallResult = false # allow function calls for side-effect only (like logic.check_acces) +useLibraryCodeForTypes = true +reportGeneralTypeIssues = true +reportPropertyTypeMismatch = true +reportWildcardImportFromLibrary = true +reportUntypedClassDecorator = false # authenticator relies on repoze.who class-decorator +reportUntypedNamedTuple = true +reportPrivateUsage = true +reportPrivateImportUsage = true +reportInconsistentConstructor = true +reportMissingSuperCall = false +reportUninitializedInstanceVariable = true +reportInvalidStringEscapeSequence = true +reportMissingParameterType = true +reportImplicitStringConcatenation = false +reportUndefinedVariable = true +reportUnboundVariable = true +reportInvalidStubStatement = true +reportIncompleteStub = true +reportUnsupportedDunderAll = true +reportUnusedCoroutine = true +reportUnnecessaryTypeIgnoreComment = true +reportMatchNotExhaustive = true \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 5e2fb6fd..168d5b0b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,11 +19,3 @@ previous = true domain = ckanext-xloader directory = ckanext/xloader/i18n statistics = true - -[tool:pytest] - -filterwarnings = - ignore::sqlalchemy.exc.SADeprecationWarning - ignore::sqlalchemy.exc.SAWarning - ignore::DeprecationWarning -addopts = --pdbcls=IPython.terminal.debugger:TerminalPdb \ No newline at end of file diff --git a/setup.py b/setup.py index 7d49c89e..cb65266c 100644 --- a/setup.py +++ b/setup.py @@ -1,91 +1,8 @@ # -*- coding: utf-8 -*- -from setuptools import setup, find_packages # Always prefer setuptools over distutils -from codecs import open # To use a consistent encoding -from os import path +from setuptools import setup -here = path.abspath(path.dirname(__file__)) - -# Get the long description from the relevant file -with open(path.join(here, 'README.md'), encoding='utf-8') as f: - long_description = f.read() setup( - name='''ckanext-xloader''', - - # Versions should comply with PEP440. For a discussion on single-sourcing - # the version across setup.py and the project code, see - # http://packaging.python.org/en/latest/tutorial.html#version - version='1.2.0', - - description='Express Loader - quickly load data into CKAN DataStore''', - long_description=long_description, - long_description_content_type='text/markdown', - - # The project's main homepage. - url='https://github.com/ckan/ckanext-xloader', - - # Author details - author='''David Read''', - author_email='''david.read@hackneyworkshop.com''', - - # Choose your license - license='AGPL', - - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - 'Development Status :: 5 - Production/Stable', - - # Pick your license as you wish (should match "license" above) - 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', - - # Specify the Python versions you support here. - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - ], - - - # What does your project relate to? - keywords='''CKAN extension datastore''', - - # You can just specify the packages manually here if your project is - # simple. Or you can use find_packages(). - packages=find_packages(exclude=['contrib', 'docs', 'tests*']), - namespace_packages=['ckanext'], - - install_requires=[ - # CKAN extensions should not list dependencies here, but in a separate - # ``requirements.txt`` file. - # - # http://docs.ckan.org/en/latest/extensions/best-practices.html#add-third-party-libraries-to-requirements-txt - ], - - # If there are data files included in your packages that need to be - # installed, specify them here. If using Python 2.6 or less, then these - # have to be included in MANIFEST.in as well. - include_package_data=True, - package_data={ - }, - - # Although 'package_data' is the preferred approach, in some case you may - # need to place data files outside of your packages. - # see http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files - # In this case, 'data_file' will be installed into '/my_data' - data_files=[], - - # To provide executable scripts, use entry points in preference to the - # "scripts" keyword. Entry points provide cross-platform support and allow - # pip to create the appropriate form of executable for the target platform. - entry_points=''' - [ckan.plugins] - xloader=ckanext.xloader.plugin:xloaderPlugin - - [babel.extractors] - ckan = ckan.lib.extract:extract_ckan - - ''', - # If you are changing from the default layout of your extension, you may # have to change the message extractors, you can read more about babel # message extraction at From b65906c6b93ceb15f0b7faa6b1250b294a8b63b2 Mon Sep 17 00:00:00 2001 From: William Dutton Date: Thu, 28 Nov 2024 06:11:16 +1000 Subject: [PATCH 2/2] chore: Update authors/maintainers --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bee3c33c..858db4ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,14 +20,14 @@ authors = [ {name = "Adrià Mercader (amercader)", email = "amercadero@gmail.com"}, {name = "David Read (davidread)"}, {name = "Brett Jones (kowh-ai)", email = "datashades@linkdigital.com.au"}, - {name = "Patricio Del Boca (pdelboca)", email = "patriciodelboca@gmail.com"}, + {name = "Patricio Del Boca (pdelboca)"}, {name = "William Dutton (duttonw)", email = "william.dutton@qld.gov.au"}, # {name = "", email = ""}, ] maintainers = [ {name = "Adrià Mercader (amercader)", email = "amercadero@gmail.com"}, {name = "William Dutton (duttonw)", email = "william.dutton@qld.gov.au"}, - {name = "Ian Ward (wardi)", email = "ian@excess.org"}, + {name = "Ian Ward (wardi)"}, {name = "Brett Jones (kowh-ai)", email = "datashades@linkdigital.com.au"}, ]