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

Installation fails using Poetry because of dependency mismatch. #22

Closed
philmade opened this issue Dec 12, 2020 · 6 comments
Closed

Installation fails using Poetry because of dependency mismatch. #22

philmade opened this issue Dec 12, 2020 · 6 comments

Comments

@philmade
Copy link

Because no versions of piccolo-admin match >0.10.3,<0.11.0
   and piccolo-admin (0.10.3) depends on uvicorn (>=0.11.0,<0.12.0), piccolo-admin (>=0.10.3,<0.11.0) requires uvicorn (>=0.11.0,<0.12.0).
  So, because pico depends on both uvicorn (^0.13.0) and piccolo-admin (^0.10.3), version solving failed.

Poetry is really annoying that way - but otherwise is a great tool. Would be great to get this fixed.

@dantownsend
Copy link
Member

@NomeChomsky Thanks for the heads up. I don't use Poetry personally, so haven't encountered this problem, but I know it's a popular tool. I'll fix it by loosening the dependencies a bit.

@dantownsend
Copy link
Member

@NomeChomsky Try version 0.10.4 of Piccolo Admin - I've loosened the dependencies. Hopefully that solves the problem.

@philmade
Copy link
Author

Fantastic dan.

So far so good with Piccollo. I've been looking for a tool like this - tightly coupled on the back end, with migrations, and loosely coupled on the front.

Piccollo looks promising, and I'm going to see how far I get with a project using it. I must say, I'm an SQL novice. I researched lots of python frameworks which are tightly coupled on the back end. Piccollo looks great. One feature I'd love to see is to integrate a 'human readable' style relationships tooling inspired by Emmett. His docs are really excellent, but so far I wasn't able to make it work seamlessly.

If you look at the way Emmett deals with relationships on models, it's a really nice implementation. I'd love to see this come to Piccollo, because defining relationships is sometimes very abstract and headachey.

For example, how might I deal with circular dependencies when passing the model into the foreignkey field? Can I pass in a string representation?

@philmade
Copy link
Author

To add - I think the command integration is also a very nice idea, and it works nicely. The idea that there's 'a correct way' to integrate table modelling into the project, and that Piccollo will bring that template in is very nice. It's a nice mix between Django 'this is how its done' styling, and Flask's micro framework style. It strikes me as a nice balance.

The Admin tool is the icing on the cake,

@dantownsend
Copy link
Member

@NomeChomsky I haven't used Emmett before, but just had a look at the docs. With the foreign key relationships in Piccolo, the ForeignKey column references another Table subclass.

class Manager(Table):
    name = Varchar(length=50)


class Band(Table):
    name = Varchar(length=50)
    manager = ForeignKey(Manager, null=True)

If you need to have tables which reference themselves, you can do it like this:

class Manager(Table):
    name = Varchar(length=50)
    manager = ForeignKey('self', null=True)

I see your point though about using string representations, because with very complex schemas you may get circular dependencies. This isn't something Piccolo currently supports, but it wouldn't be too hard to implement. I'll add it to the roadmap.

I'd like to create a tool which shows a graphic representation of the the Piccolo schema - possibly a web app, but that's in the future.

Thanks for your comments and interest in the project. I'm interesting in hearing any other thoughts you have as you build stuff with Piccolo.

@dantownsend
Copy link
Member

FYI, there's a fix for this in Piccolo 0.14.10 - ForeignKey can now accept strings, which should prevent circular dependency issues.

class Band(Table):
    name = Varchar()
    manager = ForeignKey('Manager')

class Manager(Table):
    name = Varchar()

https://piccolo-orm.readthedocs.io/en/latest/piccolo/schema/column_types.html#foreignkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants