Embarcadero / Lightweight-Python-Wrappers

Lightweight Wrappers based on Python4Delphi to make it easy to import Python modules into Delphi components.
MIT License
30 stars 11 forks source link

Alter dproj+dpks to make libs version agnostic (I hope) #10

Closed peardox closed 2 years ago

peardox commented 2 years ago

Analysis of the other dproj + dpk files in this project (i.e. P4D etc) I worked out what looked correct and tested it by wiping everything called P4DPyPackage* in /mnt/c/Users/Public/Documents/Embarcadero/Studio/21.0

Rebuilding this library recreated the properly named packages such as P4DPyPackage270.bpl (correct for CE ATM) and should also create P4DPyPackage280.bpl files for D11

Actually, this should work for all versions of Delphi regardless of version (not that I can check anything other than CE of course)

lmbelo commented 2 years ago

All packages should have the version property set to AUTO. Let me check why it turned to a specific version in some moment.

peardox commented 2 years ago

Hmm - looking at the diff Delphi's gone and converted all your 19.4s into 19.2s again - this started as a synched copy so had 19.4s...

Same for some of the othert stuff

I only actually made a few changes to replace the 280 stuff with Auto versions (and deleted 2x hard-linked D11 delpoys)

peardox commented 2 years ago

All packages should have the version property set to AUTO. let me check why it turned to a specific version in some moment.

They didn't - it was all 280 for this specific lib

lmbelo commented 2 years ago

All packages should have the version property set to AUTO. let me check why it turned to a specific version in some moment.

They didn't - it was all 280 for this specific lib

Let's update it then.

peardox commented 2 years ago

There's some Delphi IDE way of doing what I did manually I presume - fix it that way if possible

lmbelo commented 2 years ago

We don't need to track resource files. We can remove all new .res from commits.

peardox commented 2 years ago

Was just using your .gitignore

lmbelo commented 2 years ago

There's some Delphi IDE way of doing what I did manually I presume - fix it that way if possible Screen Shot 2022-08-09 at 11 17 08

lmbelo commented 2 years ago

Let's update .gitignore to exclude .res and .template.xml. We should also replicate it to the others repos.

peardox commented 2 years ago

There's some Delphi IDE way of doing what I did manually I presume - fix it that way if possible Screen Shot 2022-08-09 at 11 17 08

Ahh - I live and learn (pretty obvious when I think about it)

lmbelo commented 2 years ago

There's some Delphi IDE way of doing what I did manually I presume - fix it that way if possible Screen Shot 2022-08-09 at 11 17 08

Ahh - I live and learn (pretty obvious when I think about it)

It is only available in Delphi 10.4 and up.

peardox commented 2 years ago

Let's update .gitignore to exclude .res and .template.xml. We should also replicate it to the others repos.

And lib/

lmbelo commented 2 years ago

Let's update .gitignore to exclude .res and .template.xml. We should also replicate it to the others repos.

And lib/

Exactly.

lmbelo commented 2 years ago

Update your clone and check if the latest changes works as expected.

peardox commented 2 years ago

Line 291 is still wrong https://github.com/Embarcadero/Lightweight-Python-Wrappers/blob/main/packages/P4DPyPackage.dproj#L291

Line 148 is still wrong https://github.com/Embarcadero/Lightweight-Python-Wrappers/blob/main/packages/dclP4DPyPackage.dproj#L148

lmbelo commented 2 years ago

Line 291 is still wrong https://github.com/Embarcadero/Lightweight-Python-Wrappers/blob/main/packages/P4DPyPackage.dproj#L291

Line 148 is still wrong https://github.com/Embarcadero/Lightweight-Python-Wrappers/blob/main/packages/dclP4DPyPackage.dproj#L148

It should update automatically once you open it in other version. Did you try to compile it?

lmbelo commented 2 years ago

Line 291 is still wrong https://github.com/Embarcadero/Lightweight-Python-Wrappers/blob/main/packages/P4DPyPackage.dproj#L291 Line 148 is still wrong https://github.com/Embarcadero/Lightweight-Python-Wrappers/blob/main/packages/dclP4DPyPackage.dproj#L148

It should update automatically once you open it in other version. Did you try to compile it?

I found the issue. I'm fixing it.

peardox commented 2 years ago

I'm in the middle of tests - lemme know when you get to this one, I'll stop tests for now

Fortunately not got to this one yet

Here is a very basic set (marginally above hello world but checks it can load PSUtil + Torch) of VCL/FMX tests to make sure the full set work

https://github.com/peardox/P4D-Tests.git

lmbelo commented 2 years ago

I'm in the middle of tests - lemme know when you get to this one, I'll stop tests for now

Fortunately not got to this one yet

Here is a very basic set (marginally above hello world but checks it can load PSUtil + Torch) of VCL/FMX tests to make sure the full set work

https://github.com/peardox/P4D-Tests.git

Ah, that wasn't an issue at all, but I have upgraded project files. Let's try again.

peardox commented 2 years ago

I'm testing using the following method. Remove all traces of python stuff in (fortunately that's all these contain anyway).... C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl (21.0 will be 22.0 for you)

Install packages in correct order - 4 steps of...

p4d = Install VCL package + components for windows (fmx will be used for later tests for Android + Mac), for others = Install package + components First pass - install W32 release + debug then w64 release + debug, later passes Android / Mac Add the debug lib path for OS to options Assuming no compile issues... See if https://github.com/peardox/P4D-Tests.git run (inv VCL for Win, FMX only for others)

lmbelo commented 2 years ago

I'm testing using the following method. Remove all traces of python stuff in (fortunately that's all these contain anyway).... C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl (21.0 will be 22.0 for you)

Install packages in correct order - 4 steps of...

p4d = Install VCL package + components for windows (fmx will be used for later tests for Android + Mac), for others = Install package + components First pass - install W32 release + debug then w64 release + debug, later passes Android / Mac Add the debug lib path for OS to options Assuming no compile issues... See if https://github.com/peardox/P4D-Tests.git run (inv VCL for Win, FMX only for others)

It worth mentioning that you can use the P4DComponentSuite for a complete compilation.

lmbelo commented 2 years ago

I'm testing using the following method. Remove all traces of python stuff in (fortunately that's all these contain anyway).... C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl (21.0 will be 22.0 for you) Install packages in correct order - 4 steps of... p4d = Install VCL package + components for windows (fmx will be used for later tests for Android + Mac), for others = Install package + components First pass - install W32 release + debug then w64 release + debug, later passes Android / Mac Add the debug lib path for OS to options Assuming no compile issues... See if https://github.com/peardox/P4D-Tests.git run (inv VCL for Win, FMX only for others)

It worth mentioning that you can use the P4DComponentSuite for a complete compilation.

I need to switch back to the Python debugger for Android. We are producing some content along the DelphiFMXBuilder for the coming boot camp. Maybe I'd delay to reply, but I'll do my best. There are some small enhancements that I'd like to introduce to the whole Python projects ecosystem. I will work out as possible.

peardox commented 2 years ago

I'm testing using the following method. Remove all traces of python stuff in (fortunately that's all these contain anyway).... C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl (21.0 will be 22.0 for you) Install packages in correct order - 4 steps of... p4d = Install VCL package + components for windows (fmx will be used for later tests for Android + Mac), for others = Install package + components First pass - install W32 release + debug then w64 release + debug, later passes Android / Mac Add the debug lib path for OS to options Assuming no compile issues... See if https://github.com/peardox/P4D-Tests.git run (inv VCL for Win, FMX only for others)

It worth mentioning that you can use the P4DComponentSuite for a complete compilation.

Caused issues in the past when installing non-Windows - I'll get to that in a bit, just finishing off Windows installation.

P4D Data Science - fiddly component install...

image

This is using current repo - notice you have to click on every OTHER lib and make sure they all start dcl... This is error prone and the reason I put the DTPs in a bunch at the end - as this way click on first, shift click on last, Right Click install (much more developer friendly)

There are currently 19 components and that number will grow. They either need splitting up of bunching as I've done. Problem with splitting up is that unless handled carefully you'll end up with a really long list of paths to add to options

ATM I'm just adding e.g. C:\DelphiComponents\P4D-Data-Sciences\lib\Win32\Debug

I'd prefer something like C:\DelphiComponents\P4D-Data-Sciences\${PLATFORM)\$(Config) but that didn't work

peardox commented 2 years ago

I need to switch back to the Python debugger for Android. We are producing some content along the DelphiFMXBuilder for the coming boot camp. Maybe I'd delay to reply, but I'll do my best. There are some small enhancements that I'd like to introduce to the whole Python projects ecosystem. I will work out as possible.

Saw boot camp thing - a few topics might be of interest so just signed up

lmbelo commented 2 years ago

I'm testing using the following method. Remove all traces of python stuff in (fortunately that's all these contain anyway).... C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl (21.0 will be 22.0 for you) Install packages in correct order - 4 steps of... p4d = Install VCL package + components for windows (fmx will be used for later tests for Android + Mac), for others = Install package + components First pass - install W32 release + debug then w64 release + debug, later passes Android / Mac Add the debug lib path for OS to options Assuming no compile issues... See if https://github.com/peardox/P4D-Tests.git run (inv VCL for Win, FMX only for others)

It worth mentioning that you can use the P4DComponentSuite for a complete compilation.

Caused issues in the past when installing non-Windows - I'll get to that in a bit, just finishing off Windows installation.

P4D Data Science - fiddly component install...

image

This is using current repo - notice you have to click on every OTHER lib and make sure they all start dcl... This is error prone and the reason I put the DTPs in a bunch at the end - as this way click on first, shift click on last, Right Click install (much more developer friendly)

There are currently 19 components and that number will grow. They either need splitting up of bunching as I've done. Problem with splitting up is that unless handled carefully you'll end up with a really long list of paths to add to options

ATM I'm just adding e.g. C:\DelphiComponents\P4D-Data-Sciences\lib\Win32\Debug

I'd prefer something like C:\DelphiComponents\P4D-Data-Sciences\${PLATFORM)\$(Config) but that didn't work

I will set BOSS as the IDE package installer, then we would not need to follow up all these installation steps.

BTW, using environment variables to set up paths works fine.

peardox commented 2 years ago

The VCL test project looks like it's running (Torch install - long wait...) and I'm in a VM for testing

FMX to come...

peardox commented 2 years ago

Tried env vars, \$(Release) seemed OK but \$(Config) wan't liked (greyed out in IDE) I guess lib\$(Release)\Debug is ok though

peardox commented 2 years ago

I will set BOSS as the IDE package installer - I'll look it up

Anyway - tests ran as correctly for both VCL + FLM under Win64 so that stage of testing is complete.

Mac and Android are another issue (extremely problematic in the past)

lmbelo commented 2 years ago

I will set BOSS as the IDE package installer - I'll look it up

Anyway - tests ran as correctly for both VCL + FLM under Win64 so that stage of testing is complete.

Mac and Android are another issue (extremely problematic in the past)

It should be very straight forward to get it working on Android and Mac. Let me know if you have any issue.