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

Path is not represented in current version locations #1366

Open
CaselIT opened this issue Nov 22, 2023 Discussed in #1284 · 0 comments
Open

Path is not represented in current version locations #1366

CaselIT opened this issue Nov 22, 2023 Discussed in #1284 · 0 comments
Labels
bug Something isn't working PRs (with tests!) welcome windows MS windows related problems

Comments

@CaselIT
Copy link
Member

CaselIT commented Nov 22, 2023

Discussed in #1284

Originally posted by harpener July 27, 2023
Hi guys.

Describe the bug

Cannot generate migration in project with multiple heads because location paths do not match.

Expected behavior

Migration is generated.

To Reproduce

alembic revision --autogenerate --head "after@head" -m "my_migration"
alembic revision --autogenerate --head "before@head" -m "my_migration"

Error

FAILED: Path C:\...\alembic\after is not represented in current version locations
FAILED: Path C:\...\alembic\before is not represented in current version locations

Versions.

  • OS: Windows 11 Pro, 22H2, 22621.1992
  • Python: 3.8.17
  • Alembic: 1.11.1
  • SQLAlchemy: 1.4.48
  • Database: PostgreSQL 9.6.2

Additional context

I use two heads - after and before. I have following in alembic.ini:

version_locations = %(here)s/alembic/before %(here)s/alembic/after

I noticed that my Python returns following:

>>> import os.path

>>> os.path.abspath("")
'c:\\...'

>>> os.path.realpath("")
'C:\\...'

As you can see, the letter-case of drive letter is different which is where the problem comes from.

I haven't encountered such error in past, but I recently installed the OS anew and updated Python to its latest security fix, if it helps.

Do you have any idea what is wrong?

Have a nice day!

@CaselIT CaselIT added bug Something isn't working windows MS windows related problems PRs (with tests!) welcome labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PRs (with tests!) welcome windows MS windows related problems
Projects
None yet
Development

No branches or pull requests

1 participant