From 5cd96960fdd95b5d18fbe87a62475f51e3f75556 Mon Sep 17 00:00:00 2001 From: amercader Date: Mon, 16 Sep 2024 12:31:14 +0200 Subject: [PATCH] First iteration of pyproject.toml --- ckanext/dcat/validators.py | 9 ++++++- pyproject.toml | 50 ++++++++++++++++++++++++++++++++++++++ setup.py | 47 ----------------------------------- 3 files changed, 58 insertions(+), 48 deletions(-) create mode 100644 pyproject.toml diff --git a/ckanext/dcat/validators.py b/ckanext/dcat/validators.py index 9bf18d49..4bcace0a 100644 --- a/ckanext/dcat/validators.py +++ b/ckanext/dcat/validators.py @@ -9,7 +9,14 @@ Invalid, _, ) -from ckanext.scheming.validation import scheming_validator + + +try: + from ckanext.scheming.validation import scheming_validator +except ImportError: + def scheming_validator(func): + return func + # https://www.w3.org/TR/xmlschema11-2/#gYear regexp_xsd_year = re.compile( diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..24577bdf --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,50 @@ +[project] +name = "ckanext-dcat" +version = "2.0.0" +description = "Plugins for exposing and consuming DCAT metadata on CKAN" +authors = [ + {name = "CKAN Tech Team and contributors", email = "tech-team@ckan.org"} +] +license = {text = "AGPL"} +classifiers = [] +keywords = [] +dependencies = [] + +[project.urls] +Homepage = "http://github.com/ckan/ckanext-dcat" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +#[build-system] +#requires = ["setuptools", "wheel"] +#build-backend = "setuptools.build_meta" +# +[tool.setuptools] +#packages = ["ckanext"] +#namespace-packages = ["ckanext"] +include-package-data = true + +[tool.setuptools.packages] +find = {} + + +[project.entry-points."ckan.plugins"] +dcat_xml_harvester = "ckanext.dcat.harvesters:DCATXMLHarvester" +dcat_json_harvester = "ckanext.dcat.harvesters:DCATJSONHarvester" +dcat_rdf_harvester = "ckanext.dcat.harvesters:DCATRDFHarvester" +dcat_json_interface = "ckanext.dcat.plugins:DCATJSONInterface" +dcat = "ckanext.dcat.plugins:DCATPlugin" +structured_data = "ckanext.dcat.plugins:StructuredDataPlugin" +# Test plugins +test_rdf_harvester = "ckanext.dcat.tests.harvester.test_harvester:TestRDFHarvester" +test_rdf_null_harvester = "ckanext.dcat.tests.harvester.test_harvester:TestRDFNullHarvester" +test_rdf_exception_harvester = "ckanext.dcat.tests.harvester.test_harvester:TestRDFExceptionHarvester" + +[project.entry-points."ckan.rdf.profiles"] +euro_dcat_ap = "ckanext.dcat.profiles:EuropeanDCATAPProfile" +euro_dcat_ap_2 = "ckanext.dcat.profiles:EuropeanDCATAP2Profile" +euro_dcat_ap_3 = "ckanext.dcat.profiles:EuropeanDCATAP3Profile" +euro_dcat_ap_scheming = "ckanext.dcat.profiles:EuropeanDCATAPSchemingProfile" +schemaorg = "ckanext.dcat.profiles:SchemaOrgProfile" diff --git a/setup.py b/setup.py index 9a600e06..50e85ecc 100644 --- a/setup.py +++ b/setup.py @@ -3,53 +3,6 @@ version = '2.0.0' setup( - name='ckanext-dcat', - version=version, - description="Plugins for exposing and consuming DCAT metadata on CKAN", - long_description='''\ - ''', - classifiers=[], - keywords='', - author='Open Knowledge Foundation', - author_email='info@ckan.org', - url='https://github.com/okfn/ckanext-dcat', - license='AGPL', - packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), - namespace_packages=['ckanext'], - include_package_data=True, - zip_safe=False, - install_requires=[ - # -*- Extra requirements: -*- - ], - entry_points=''' - - [ckan.plugins] - dcat_xml_harvester=ckanext.dcat.harvesters:DCATXMLHarvester - dcat_json_harvester=ckanext.dcat.harvesters:DCATJSONHarvester - - dcat_rdf_harvester=ckanext.dcat.harvesters:DCATRDFHarvester - - dcat_json_interface=ckanext.dcat.plugins:DCATJSONInterface - - dcat=ckanext.dcat.plugins:DCATPlugin - - structured_data=ckanext.dcat.plugins:StructuredDataPlugin - - # Test plugins - test_rdf_harvester=ckanext.dcat.tests.harvester.test_harvester:TestRDFHarvester - test_rdf_null_harvester=ckanext.dcat.tests.harvester.test_harvester:TestRDFNullHarvester - test_rdf_exception_harvester=ckanext.dcat.tests.harvester.test_harvester:TestRDFExceptionHarvester - - [ckan.rdf.profiles] - euro_dcat_ap=ckanext.dcat.profiles:EuropeanDCATAPProfile - euro_dcat_ap_2=ckanext.dcat.profiles:EuropeanDCATAP2Profile - euro_dcat_ap_3=ckanext.dcat.profiles:EuropeanDCATAP3Profile - euro_dcat_ap_scheming=ckanext.dcat.profiles:EuropeanDCATAPSchemingProfile - schemaorg=ckanext.dcat.profiles:SchemaOrgProfile - - [babel.extractors] - ckan = ckan.lib.extract:extract_ckan - ''', message_extractors={ 'ckanext': [ ('**.py', 'python', None),