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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce compatibility with native namespace packages #375

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

parthea
Copy link
Contributor

@parthea parthea commented Nov 14, 2023

This PR:

To obtain the version at runtime, use google.cloud.sqlalchemy_spanner.__version__

(py39) partheniou@partheniou-vm-3:~/git/python-spanner-sqlalchemy$ python3
Python 3.9.16 (main, Mar  2 2023, 17:52:22) 
[GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import google.cloud.sqlalchemy_spanner 
>>> google.cloud.sqlalchemy_spanner.__version__
'1.6.2'

Fixes #337 馃

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. label Nov 14, 2023
@parthea parthea force-pushed the migrate-to-native-namespace-packages branch 2 times, most recently from fdcceeb to 1547b36 Compare November 14, 2023 16:00
@parthea
Copy link
Contributor Author

parthea commented Nov 14, 2023

Adding do not merge as there is an upcoming release freeze. This should be merged after the release freeze ends on November 29th.

@parthea parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 14, 2023
@parthea parthea force-pushed the migrate-to-native-namespace-packages branch 2 times, most recently from c0382d3 to f795ed5 Compare November 14, 2023 16:03
@parthea parthea force-pushed the migrate-to-native-namespace-packages branch from f795ed5 to 29285a5 Compare November 14, 2023 16:19
@harshachinta
Copy link
Contributor

Hi @parthea,
The python-spanner-sqlalchemy presubmits are failing with below error after the latest 3.41.0 release of python-spanner,

ModuleNotFoundError: No module named 'google.cloud.spanner_v1'

From my analysis below, it looks like this PR should be merged for the presubmits to not face this issue.

Analysis

  1. I wrote a sample Python application with python-spanner 3.41.0 as dependency (Assuming python-spanner release is the issue), but the application did not face this import issue and was working perfectly.
  2. This should be some issue with the python-spanner-sqlalchemy package setup. Analyzing more pointed out to this PR which is in draft stage. We did the same change in python-spanner in the latest release.
  3. I checked out this PR on my local and ran presubmits. The above import issue was not seen. I think we should merge this PR to have similar package setup as python-spanner.

cc: @ankiaga @olavloite

@parthea
Copy link
Contributor Author

parthea commented Jan 16, 2024

@harshachinta,

Please can you check if the issue is resolved with this PR which removes editable installations from tests? #383

There are limitations for editable installations, and this type of installation is still listed as experimental on pypa.io:
https://setuptools.pypa.io/en/latest/userguide/development_mode.html#limitations

We may be able to improve support for editable installations by switching to a src layout instead of a flat layout.
googleapis/google-cloud-python#12078

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. do not merge Indicates a pull request not ready for merge, due to either quality or timing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

version.py missing from source on PyPI
2 participants