diff --git a/CHANGES.txt b/CHANGES.txt index bb32a089..38272871 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -17,9 +17,12 @@ Unreleased - Error handling: At two spots in cursor / value converter handling, where ``assert`` statements have been used, ``ValueError`` exceptions are raised now. +- Python: Migrated to use "implicit namespace packages" instead of "declared + namespaces" for the ``crate`` namespace package, see `PEP 420`_. .. _Migrate from crate.client to sqlalchemy-cratedb: https://cratedb.com/docs/sqlalchemy-cratedb/migrate-from-crate-client.html +.. _PEP 420: https://peps.python.org/pep-0420/ .. _sqlalchemy-cratedb: https://pypi.org/project/sqlalchemy-cratedb/ diff --git a/setup.py b/setup.py index 958b746f..8f9ed5bc 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ import os import re -from setuptools import find_packages, setup +from setuptools import find_namespace_packages, setup def read(path): @@ -45,15 +45,14 @@ def read(path): url="https://github.com/crate/crate-python", author="Crate.io", author_email="office@crate.io", - package_dir={"": "src"}, description="CrateDB Python Client", long_description=long_description, long_description_content_type="text/x-rst", platforms=["any"], license="Apache License 2.0", keywords="cratedb db api dbapi database sql http rdbms olap", - packages=find_packages("src"), - namespace_packages=["crate"], + packages=find_namespace_packages("src"), + package_dir={"": "src"}, install_requires=[ "urllib3<2.3", "verlib2==0.2.0", diff --git a/src/crate/__init__.py b/src/crate/__init__.py index 026c0677..e69de29b 100644 --- a/src/crate/__init__.py +++ b/src/crate/__init__.py @@ -1,30 +0,0 @@ -# -*- coding: utf-8; -*- -# -# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor -# license agreements. See the NOTICE file distributed with this work for -# additional information regarding copyright ownership. Crate licenses -# this file to you under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. You may -# obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# However, if you have executed another commercial license agreement -# with Crate these terms will supersede the license and you may use the -# software solely pursuant to the terms of the relevant commercial agreement. - -# this is a namespace package -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/src/crate/testing/__init__.py b/src/crate/testing/__init__.py index 5bb534f7..e69de29b 100644 --- a/src/crate/testing/__init__.py +++ b/src/crate/testing/__init__.py @@ -1 +0,0 @@ -# package