Skip to content

Commit

Permalink
Python: Migrate to use "implicit namespace packages" (PEP 420)
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Nov 4, 2024
1 parent 931f782 commit 7034388
Show file tree
Hide file tree
Showing 20 changed files with 13 additions and 38 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Changes for crash

Unreleased
==========
- Python: Migrated to use "implicit namespace packages" instead of "declared
namespaces" for the ``crate`` namespace package, see `PEP 420`_.

.. _PEP 420: https://peps.python.org/pep-0420/

2024/04/24 0.31.5
=================
Expand Down
30 changes: 0 additions & 30 deletions crate/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions devtools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -e -x

isort --check --diff crate/ tests/ setup.py
flake8 crate/crash
isort --check --diff src/crate/ tests/ setup.py
flake8 src/crate/crash
coverage run -m unittest -v
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def read(path):
read('README.rst')
)

versionf_content = read(os.path.join('crate', 'crash', '__init__.py'))
versionf_content = read(os.path.join('src', 'crate', 'crash', '__init__.py'))
version_rex = r'^__version__ = [\'"]([^\'"]*)[\'"]$'
m = re.search(version_rex, versionf_content, re.M)
if m:
Expand All @@ -68,17 +68,18 @@ def read(path):
license='Apache License 2.0',
keywords='cratedb db data client shell',
packages=['crate.crash'],
namespace_packages=['crate'],
package_dir={"": "src"},
entry_points={
'console_scripts': [
'crash = crate.crash.command:main',
]
},
extras_require=dict(
test=[
'crate[test]',
'crate[test]>=1.0.0.dev2',
'cratedb-toolkit[testing]',
'sqlalchemy-cratedb',
'zc.customdoctests<2',
'cratedb-toolkit[test]',
],
devel=[
'coverage<8',
Expand Down
Empty file added src/crate/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def __call__(self, *args, **kwargs):
class DocumentationTest(TestCase):

def test_output(self):
testfile('../crate/crash/output.txt')
testfile('../src/crate/crash/output.txt')

def test_connect(self):
testfile('../crate/crash/connect.txt')
testfile('../src/crate/crash/connect.txt')


class CommandTest(TestCase):
Expand Down

0 comments on commit 7034388

Please sign in to comment.