collorg/halfORM_packager

HalfORM 0.6.2 [hop new] psycopg2.errors.FeatureNotSupported: cross-database references are not implemented

Closed this issue · 3 comments

After hop new, I simply get this error.

Pipfile:

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
half-orm-packager = ">=0.0.19"
$ pipenv install --skip-lock
Creating a virtualenv for this project…
Using /usr/bin/python3 (3.9.2) to create virtualenv…
⠋created virtual environment CPython3.9.2.final.0-64 in 85ms
  creator CPython3Posix(dest=/home/emixam/.local/share/virtualenvs/hophop-q8O0vTON, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/emixam/.local/share/virtualenv)
    added seed packages: pip==20.3.4, pkg_resources==0.0.0, setuptools==44.1.1, wheel==0.34.2
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

Virtualenv location: /home/emixam/.local/share/virtualenvs/hophop-q8O0vTON                            Installing dependencies from Pipfile…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:04
To activate this project's virtualenv, run the following:
 $ pipenv shell
$ HALFORM_CONF_DIR=/tmp/lol pipenv run hop new project
HALFORM_CONF_DIR: /tmp/lol
Connection parameters to the database:
. database name (project): 
. user (emixam): 
. password: 
. is it an ident login with a local account? [Y/n] 
Production (False): 
The database 'project' does not exist.
Do you want to create it (Y/n): 
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /mnt/glarg/src/lirmm/si-v4/hop/hophop/project/.git/
WARN: creating hop_main branch.
CompletedProcess(args=['pg_dump', 'project', '-f', '/mnt/glarg/src/lirmm/si-v4/hop/hophop/project/Backups/project-pre-patch.sql'], returncode=0, stderr=b'')
Initializing the patch system for the 'project' database.
Patch system initialized at release '0.0.0'.

The hop project 'project' has been created.

Next possible hop command(s):

I'd like to know what are the next possible hop commands?

$ cd project
# vim Pipfile:  change python_version to 3.9 because by default, half_orm generated with version 3.8, even if I used "hop" with python 3.9

$ pipenv install --skip-lock
Installing dependencies from Pipfile…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:02
To activate this project's virtualenv, run the following:
 $ pipenv shell

$ pipenv install --skip-lock --dev
Installing dependencies from Pipfile…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 6/6 — 00:00:11
To activate this project's virtualenv, run the following:
 $ pipenv shell

HALFORM_CONF_DIR=/tmp/lol/ pipenv run hop --verbose
halfORM packager
QUERY: select
  r140303305194800.*
from
   half_orm_meta.view.hop_last_release as r140303305194800
  
where
    (1 = 1)
VALUES: ()
Traceback (most recent call last):
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/bin/hop", line 8, in <module>
    sys.exit(main())
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/click/core.py", line 1635, in invoke
    rv = super().invoke(ctx)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/half_orm_packager/hop.py", line 50, in main
    HOP.status(verbose)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/half_orm_packager/utils.py", line 165, in status
    print(self)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/half_orm_packager/utils.py", line 313, in __str__
    DB release: {self.get_release_s(self.get_current_db_release())}
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/half_orm_packager/utils.py", line 138, in get_current_db_release
    return next(self.model.get_relation_class('half_orm_meta.view.hop_last_release')().select())
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/half_orm/relation.py", line 559, in select
    raise err
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/half_orm/relation.py", line 556, in select
    self.__execute(query, values)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/half_orm/relation.py", line 154, in __execute
    return self.__cursor.execute(query, values)
  File "/home/emixam/.local/share/virtualenvs/project-h2hzFwBv/lib/python3.9/site-packages/psycopg2/extras.py", line 236, in execute
    return super().execute(query, vars)
psycopg2.errors.FeatureNotSupported: cross-database references are not implemented: "half_orm_meta.view.hop_last_release"
LINE 4:    half_orm_meta.view.hop_last_release as r140303305194800
           ^

Postgresql version : psql (PostgreSQL) 13.5 (Debian 13.5-0+deb11u1)

Pipenv graph

build==0.7.0
  - packaging [required: >=19.0, installed: 21.3]
    - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9]
  - pep517 [required: >=0.9.1, installed: 0.12.0]
    - tomli [required: >=1.1.0, installed: 2.0.1]
  - tomli [required: >=1.0.0, installed: 2.0.1]
half-orm-packager==0.0.19
  - click [required: Any, installed: 8.1.3]
  - GitPython [required: Any, installed: 3.1.27]
    - gitdb [required: <5,>=4.0.1, installed: 4.0.9]
      - smmap [required: >=3.0.1,<6, installed: 5.0.0]
  - half-orm [required: >=0.5.5, installed: 0.6.2]
    - psycopg2-binary [required: Any, installed: 2.9.3]
    - PyYAML [required: Any, installed: 6.0]
  - pydash [required: Any, installed: 5.1.0]
pkg-resources==0.0.0
pytest==7.1.2
  - attrs [required: >=19.2.0, installed: 21.4.0]
  - iniconfig [required: Any, installed: 1.1.1]
  - packaging [required: Any, installed: 21.3]
    - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9]
  - pluggy [required: <2.0,>=0.12, installed: 1.0.0]
  - py [required: >=1.8.2, installed: 1.11.0]
  - tomli [required: >=1.0.0, installed: 2.0.1]
tox==3.25.0
  - filelock [required: >=3.0.0, installed: 3.7.0]
  - packaging [required: >=14, installed: 21.3]
    - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9]
  - pluggy [required: >=0.12.0, installed: 1.0.0]
  - py [required: >=1.4.17, installed: 1.11.0]
  - six [required: >=1.14.0, installed: 1.16.0]
  - toml [required: >=0.9.4, installed: 0.10.2]
  - virtualenv [required: !=20.0.3,!=20.0.5,!=20.0.4,!=20.0.2,>=16.0.0,!=20.0.1,!=20.0.0,!=20.0.7,!=20.0.6, installed: 20.14.1]
    - distlib [required: >=0.3.1,<1, installed: 0.3.4]
    - filelock [required: >=3.2,<4, installed: 3.7.0]
    - platformdirs [required: >=2,<3, installed: 2.5.2]
    - six [required: <2,>=1.9.0, installed: 1.16.0]
twine==4.0.0
  - importlib-metadata [required: >=3.6, installed: 4.11.3]
    - zipp [required: >=0.5, installed: 3.8.0]
  - keyring [required: >=15.1, installed: 23.5.0]
    - importlib-metadata [required: >=3.6, installed: 4.11.3]
      - zipp [required: >=0.5, installed: 3.8.0]
    - jeepney [required: >=0.4.2, installed: 0.8.0]
    - SecretStorage [required: >=3.2, installed: 3.3.2]
      - cryptography [required: >=2.0, installed: 37.0.2]
        - cffi [required: >=1.12, installed: 1.15.0]
          - pycparser [required: Any, installed: 2.21]
      - jeepney [required: >=0.6, installed: 0.8.0]
  - pkginfo [required: >=1.8.1, installed: 1.8.2]
  - readme-renderer [required: >=21.0, installed: 35.0]
    - bleach [required: >=2.1.0, installed: 5.0.0]
      - six [required: >=1.9.0, installed: 1.16.0]
      - webencodings [required: Any, installed: 0.5.1]
    - docutils [required: >=0.13.1, installed: 0.18.1]
    - Pygments [required: >=2.5.1, installed: 2.12.0]
  - requests [required: >=2.20, installed: 2.27.1]
    - certifi [required: >=2017.4.17, installed: 2021.10.8]
    - charset-normalizer [required: ~=2.0.0, installed: 2.0.12]
    - idna [required: <4,>=2.5, installed: 3.3]
    - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.9]
  - requests-toolbelt [required: >=0.8.0,!=0.9.0, installed: 0.9.1]
    - requests [required: >=2.0.1,<3.0.0, installed: 2.27.1]
      - certifi [required: >=2017.4.17, installed: 2021.10.8]
      - charset-normalizer [required: ~=2.0.0, installed: 2.0.12]
      - idna [required: <4,>=2.5, installed: 3.3]
      - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.9]
  - rfc3986 [required: >=1.4.0, installed: 2.0.0]
  - rich [required: >=12.0.0, installed: 12.4.1]
    - commonmark [required: <0.10.0,>=0.9.0, installed: 0.9.1]
    - pygments [required: >=2.6.0,<3.0.0, installed: 2.12.0]
  - urllib3 [required: >=1.26.0, installed: 1.26.9]

This is a regression with halfOrm 0.6.2

fix with half_orm 0.6.3