aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Python Support in Aspire

Open dorgrn opened this issue 1 year ago • 7 comments
trafficstars

Hey team,

I’ve been exploring Aspire, and it’s impressive! But here’s the thing: Python support is a must for us. Many data science teams, including ours, rely on Python containers. Since Visual Studio already supports Python, adding it to Aspire would be a game-changer.

Cheers. @davidfowl - FYI

dorgrn avatar Mar 10 '24 08:03 dorgrn

@dorgrin6 What do you mean by supporting Python?

There could be multiple things:

  1. Running python based apps natively like with Node support?

  2. ServiceDiscovery package for Python?

  3. A whole separate Aspire.Python package which imitates behavior of Aspire but for Python?

I think you can easily hack together 1 and 2 and see how it goes.

As for 3 I don't think there is a need for this kind of thing - Python community can easily do the thing themselves.

I guess Node native support is a must because .Net backend + js/ts + node frontend is standard thing. I can't say the same for Python + .Net honestly.

En3Tho avatar Mar 10 '24 15:03 En3Tho

I guess 1 & 2 would be nice but 3 is what's needed here.

I'll try to hack this together as proposed. Would node integration be a good example for this? (AddNpmApp)

dorgrn avatar Mar 13 '24 08:03 dorgrn

@dorgrin6 in terms of 1 & 2 I'd be interested in seeing a PR for Aspire. I think item 3 is probably a different open source project entirely.

mitchdenny avatar Apr 09 '24 06:04 mitchdenny

I'm working on a separate package for Python support. https://github.com/wmeints/aspire-python

If it sounds useful, I can make a PR to integrate the code into the main project. Not sure if it's necessary as I haven't found any limitations while building python support as a separate package.

wmeints avatar May 09 '24 09:05 wmeints

Turns out there are a couple of limitations for extending the hosting bits outside of the main repo. For one, testing is harder because you need to build your own testing infrastructure. Which involves copying over quite a lot of code. Also, there are a few handy utilities in the hosting project that I would like to use without copying over code to my own package.

So instead of building my own package, I propose to use my PR that I submitted.

wmeints avatar May 10 '24 09:05 wmeints

Python support is almost certainly something we'd want to support in-tree anyway since its pretty common in things like AI and data science scenarios.

mitchdenny avatar May 13 '24 01:05 mitchdenny

There is a meta conversation here which is not Python specific about how we want to handle closely related application frameworks:

https://github.com/dotnet/aspire/issues/4163

Interesting for Node.js we don't have APIs which are specific to say ExpressJS?

mitchdenny avatar May 13 '24 08:05 mitchdenny

Fixed by https://github.com/dotnet/aspire/issues/2760

davidfowl avatar Jun 26 '24 05:06 davidfowl

*fixed by #4142

Meir017 avatar Jul 17 '24 05:07 Meir017