Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Migrate to use "implicit namespace packages" (PEP 420) #448

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[wheel]
universal=1

[flake8]
ignore = E501, C901, W503, E741
exclude = tabulate.py
Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
requirements = [
'colorama<1',
'Pygments>=2.4,<3',
'crate>=0.35.2',
'crate>=1.0.0.dev2',
'platformdirs<5',
'prompt-toolkit>=3.0,<4',
'tabulate>=0.9,<0.10',
Expand All @@ -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 @@ -66,19 +66,20 @@ def read(path):
long_description_content_type='text/x-rst',
platforms=['any'],
license='Apache License 2.0',
keywords='crate db data client shell',
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