Skip to content

Commit

Permalink
Python: Fix "implicit namespace packages" migration
Browse files Browse the repository at this point in the history
... by omitting `__init__.py` from `crate` namespace package altogether,
see "PEP 420" [1] and "Package Discovery and Namespace Package » Finding
namespace packages" [2].

[1] https://peps.python.org/pep-0420/
[2] https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#namespace-packages
  • Loading branch information
amotl committed Nov 21, 2024
1 parent e492ce6 commit f717e7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ Changes for crash
Unreleased
==========
- Python: Migrated to use "implicit namespace packages" instead of "declared
namespaces" for the ``crate`` namespace package, see `PEP 420`_.
namespaces" for the ``crate`` namespace package, see `PEP 420`_
and `Package Discovery and Namespace Package » Finding namespace packages`_.

.. _Package Discovery and Namespace Package » Finding namespace packages: https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#namespace-packages
.. _PEP 420: https://peps.python.org/pep-0420/

2024/04/24 0.31.5
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import os
import re

from setuptools import setup
from setuptools import find_namespace_packages, setup

requirements = [
'colorama<1',
Expand Down Expand Up @@ -67,7 +67,7 @@ def read(path):
platforms=['any'],
license='Apache License 2.0',
keywords='cratedb db data client shell',
packages=['crate.crash'],
packages=find_namespace_packages("src"),
package_dir={"": "src"},
entry_points={
'console_scripts': [
Expand Down
Empty file removed src/crate/__init__.py
Empty file.

0 comments on commit f717e7f

Please sign in to comment.