-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: Migrate to use "implicit namespace packages" (PEP 420)
... instead of "declared namespaces" for the `crate` namespace package, see PEP 420 [1], and setuptools docs [2]. > Historically, there were two methods to create namespace packages. One > is the `pkg_resources` style supported by `setuptools` and the other > one being `pkgutils` style offered by `pkgutils` module in Python. > Both are now considered _deprecated_. > > -- Legacy Namespace Packages [3] [1] https://peps.python.org/pep-0420/ [2] https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages [3] https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#legacy-namespace-packages
- Loading branch information
Showing
4 changed files
with
6 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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="[email protected]", | ||
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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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__) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
# package | ||