Ok, I jumped through a few hoops, made use of an undocumented feature
of poetry, did some final tweaks, and now it seems to work for me:

https://test.pypi.org/project/mnemosyne/

Devin, could you try and see if this also works on Mac, and perhaps
write some Mac-specific instructions so that a non-technical user is
able to install it that way?

There is one final hurdle, though, and that is that I can't register
mnemosyne on the actual pypi site, as opposed to the test-pypi site.
Perhaps somebody already claimed the name? In any case, I've opened a
request to try and fix this...

Cheers,

Peter

On Thu, Oct 5, 2023 at 3:23 AM Ace Alba <ace.z.alba....@gmail.com> wrote:
>
> Also, wheel needs to be installed 'pip install wheel' before running 'python3 
> setup.py bdist_wheel'.
>
> On Thursday, October 5, 2023 at 9:19:15 AM UTC+8 Ace Alba wrote:
>>
>> This is unfamiliar terrain for me. Poetry cannot access makefile commands, 
>> but can access python commands, I think. I think you are in the right 
>> direction; what you did for pyqt_ui, you do for the rest of the build 
>> commands. Either that or access the make commands from a python script, then 
>> register that in pyproject.toml.
>>
>> As for the wheel generation... well everytime i try something in google 
>> there's just commenters in github issues duking it on what the proper 
>> behavior should be. Woe the hellscape that is python's packaging ecosystem.
>>
>> Anyhow, from this github issue, https://github.com/pypa/wheel/issues/276... 
>> here is a possible solution:
>> Python3 setup.py bdist_wheel.
>>
>> Other than that i haven't found a way yet to generate the wheel directly 
>> from an sdist. I'll update if I ever find something.
>> On Thursday, October 5, 2023 at 1:17:39 AM UTC+8 Peter Bienstman wrote:
>>>
>>> 'python3 setup.py sdist' just creates the source, not a wheel. Anyway,
>>> I made some progress by adding a section [tool.poetry.scripts] to
>>> pyproject.toml and doing some other minor changes. Now an executable
>>> is added to the Scripts directory which starts to run Mnemosyne.
>>> However, where it currently fails is that the new poetry
>>> infrastructure does not know that it should build the dependencies
>>> (build, build-po in the makefile)...
>>>
>>> Ace, any idea how best to do this?
>>>
>>> Thanks!
>>>
>>> Peter
>>>
>>> On Wed, Oct 4, 2023 at 12:44 PM Ace Alba <ace.z.a...@gmail.com> wrote:
>>> >
>>> > When building the dists, we might need to use
>>> >
>>> > python3 setup.py sdist
>>> >
>>> > Instead of Python3 -m build... ?
>>> >
>>> > Then reupload the packages to testpypi.
>>> > On Wednesday, October 4, 2023 at 6:18:45 PM UTC+8 Peter Bienstman wrote:
>>> >>
>>> >> Excellent detective work, thanks a lot!
>>> >>
>>> >> I've tried the second option in a virtual environment, and it seems to
>>> >> install everything just fine, apart from the main script to start
>>> >> Mnemosye... In setup.py the location of this script is mentioned, but
>>> >> perhaps there's something in the new poetry infrastructure that needs
>>> >> to change in order to accomodate this as well? (I've very little
>>> >> experience with poetry)
>>> >>
>>> >> Cheers,
>>> >>
>>> >> Peter
>>> >>
>>> >> On Wed, Oct 4, 2023 at 11:52 AM Ace Alba <ace.z.a...@gmail.com> wrote:
>>> >> >
>>> >> > Edit: Here's the solution for option two, which is much simpler. Use 
>>> >> > this command instead.
>>> >> >
>>> >> > pip install --index-url https://test.pypi.org/simple/ 
>>> >> > --extra-index-url https://pypi.org/simple/ mnemosyne==2.10.1
>>> >> >
>>> >> > This command allows pip to use pypi as an alternative repo in 
>>> >> > resolving the dependencies. works on my end.
>>> >> > On Wednesday, October 4, 2023 at 5:45:14 PM UTC+8 Ace Alba wrote:
>>> >> >>
>>> >> >> Here's our blocker. It's no one's fault but the nature of how pip 
>>> >> >> resolves dependencies. See
>>> >> >>
>>> >> >> https://stackoverflow.com/questions/49900875/pip-install-fails-to-install-dependencies
>>> >> >>
>>> >> >> With the following paragraph:
>>> >> >>
>>> >> >> When installing a package from testPyPI, the dependencies are also 
>>> >> >> installed from there. And it seems, that while there are many 
>>> >> >> packages available, pytables and progress are apparently missing. 
>>> >> >> This caused the installation to fail.
>>> >> >>
>>> >> >> So though we followed the instructions to the letter, we cannot 
>>> >> >> proceed because testpypi will always get the packages from testpypi 
>>> >> >> repository (which does not have the dependencies), not from pypi 
>>> >> >> (where the dependencies are actually located). So installing our test 
>>> >> >> package from testpypi will always cause it to break.
>>> >> >>
>>> >> >> We have two options:
>>> >> >> 1. A test deploy from pypi itself.
>>> >> >>
>>> >> >> because the commands listed rely on pyproject.toml, all you need is 
>>> >> >> to:
>>> >> >> - rename the package name in pyproject.toml (i.e. mnemosyne-test or 
>>> >> >> another name)
>>> >> >> - clear out everything from the dist/ folder
>>> >> >> - go do the same process again in the article (register a pypi 
>>> >> >> account, python3 -m build, etc.,) up until..
>>> >> >> - when uploading the distributions, use `twine upload --verbose 
>>> >> >> --repository pypi dist/*` instead of `testpypi`
>>> >> >> - download the package using the pip install command
>>> >> >> - if the package is successfully installed, i guess it is successful. 
>>> >> >> so the test package can be deleted from pypi.
>>> >> >> - then restore back the proper package name in pyproject.toml. purge 
>>> >> >> all contest of dist/*, then do everything all over again.
>>> >> >>
>>> >> >> 2. figure out a way for pip to resolve the dependency tree from pypi 
>>> >> >> instead of testpypi. I don't know how to do this.
>>> >> >
>>> >> > --
>>> >> > You received this message because you are subscribed to the Google 
>>> >> > Groups "mnemosyne-proj-users" group.
>>> >> > To unsubscribe from this group and stop receiving emails from it, send 
>>> >> > an email to mnemosyne-proj-u...@googlegroups.com.
>>> >> > To view this discussion on the web visit 
>>> >> > https://groups.google.com/d/msgid/mnemosyne-proj-users/a478ec86-5a17-4215-920e-d41208eaf735n%40googlegroups.com.
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google Groups 
>>> > "mnemosyne-proj-users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send an 
>>> > email to mnemosyne-proj-u...@googlegroups.com.
>>> > To view this discussion on the web visit 
>>> > https://groups.google.com/d/msgid/mnemosyne-proj-users/bb174636-3457-420b-b9e2-f6dd8b47e8bdn%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "mnemosyne-proj-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mnemosyne-proj-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mnemosyne-proj-users/d32aa821-9d3b-4353-87ee-b9b8a8343babn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"mnemosyne-proj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mnemosyne-proj-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mnemosyne-proj-users/CAMdxoPE8BFxzDBMO6uijoussqPAhDjk8xFUNxjVwNGboeooTHw%40mail.gmail.com.

Reply via email to