soegaard2
2022-7-25 13:16:17

Hi All.

The Python library I have been working on is taking form.

Right now I am moving it to Github, but I have run into a “can’t see the forrest for the trees” problem.

I have split the package pyffi into smaller packages: pyffi-lib and pyffi-doc (and later pyffi-test). The info file for pyffi states it is an multi collection package. Now, in pyffi-lib I have a folder python and an info file which says pyffi-lib is a multi collection package. In python/ the info file has (define collection "python").

I expected this would create a collection python that I could require with (require python). But I get an error: Users/soegaard/tmp/test-pyffi.rkt:2:9: collection not found for module path: python collection: "python" in collection directories: /Users/soegaard/Library/Racket/8.4/collects /Applications/Racket v8.4/collects/ ... [180 additional linked and package directories] Any help is appreciated.

https://github.com/soegaard/pyffi


sorawee
2022-7-25 13:26:28
  1. Based on https://github.com/lexi-lambda/racket-collections/tree/master/collections-lib, I don’t think you need (define collection "python")

sorawee
2022-7-25 13:26:48
  1. Your package is going to conflict with https://pkgs.racket-lang.org/package/python

sorawee
2022-7-25 13:27:15
  1. info.rkt requires ffi, which is not yet registered

sorawee
2022-7-25 13:28:19
  1. pyfii-tests doesn’t exist

massung
2022-7-25 13:28:47

Not a solution to your problem (sorry), but rather a curious question.

Why split up the package into pyffi-lib and pyffi-doc and pyffi-test? I see lots of packages do that and I find it a bit frustrating (so there has to be a good reason for it, right?).

Example: if I go to (assuming registered) https://pkgs.racket-lang.org/package/pyffi, there’s no nice “Documentation” button I can use to browse it. Instead, I have to try and navigate around and stumble upon pyffi-doc, which is where it is.


massung
2022-7-25 13:29:51

And I can’t remember if the package server spuriously shows that pyffi is missing documentation and tests since those are actually in other packages?


sorawee
2022-7-25 13:30:24

@massung if you install Minimal Racket, you will not have a great time installing most packages, since it will transitively install Scribble, RackUnit, etc.

By splitting the package to -lib, -doc, etc, specifying the -lib variant as a dependency won’t pull in Scribble and RackUnit (which if I recall correctly could pull in heavier stuff like the GUI framework)


massung
2022-7-25 13:31:45

ok. feels like something that should be solved another way, but I get it. Thanks!


sorawee
2022-7-25 13:32:47

Totally! There’s already a concept of binary package, which “compiles” a regular package so that it doesn’t need any build-time dependencies. Unfortunately, it only works for the current release


soegaard2
2022-7-25 13:32:50

@sorawee 1. As you probably guessed, I can’t figure out why the python collection doesn’t show up, so I tried without too. 2. Thanks. I search the docs for python and didn’t find anything. Should have tried http://pkgs.racket-lang.org\|pkgs.racket-lang.org instead. 3. Yes - one thing at a time :slightly_smiling_face: 4. Same.


soegaard2
2022-7-25 13:34:14

I’ll begin renaming python to pyffi and see if things magically works (since the package name and collection name will be the same.


soegaard2
2022-7-25 13:48:29

@sorawee I have fixed 1, 2, 3, and 4. But I get the same error: % cat ~/tmp/test-pyffi.rkt && racket84 ~/tmp/test-pyffi.rkt #lang racket (require pyffi) /Users/soegaard/tmp/test-pyffi.rkt:2:9: cannot open module file module path: pyffi path: /Users/soegaard/Dropbox/GitHub/pyffi/main.rkt system error: no such file or directory; rkt_err=3 location...: /Users/soegaard/tmp/test-pyffi.rkt:2:9


soegaard2
2022-7-25 13:48:56

I used raco84 pkg update pyffi/ after the changes.


sorawee
2022-7-25 13:50:07

What I’m confused is, you said you don’t know that the package python is a thing


sorawee
2022-7-25 13:50:15

But then python is one of your deps.


soegaard2
2022-7-25 13:52:40

I know of Pedros #lang python . There shouldn’t be a dependcy though. I experimented with something in his package a long time ago. Have I forgotten to remove something?


sorawee
2022-7-25 13:53:16

In pyffi-lib’s info.rkt


soegaard2
2022-7-25 13:54:22

Before I had pyffi-lib/python and now I renamed the folder to pyffi but forgot to update deps. Note it says "python" not python.


sorawee
2022-7-25 13:55:23

But deps is a list of package sources (which are strings).


sorawee
2022-7-25 13:56:51

So (define deps '(python)) is in fact wrong. And (define deps '("python")) is correct, but it refers to the package on the package catalog, not a local collection.


soegaard2
2022-7-25 13:57:55

True. Rereading the error message: path: /Users/soegaard/Dropbox/GitHub/pyffi/main.rkt system error: no such file or directory; rkt_err=3 If I add a “main.rkt” to pyffi/pyffi that just reexports everything from pyffi-lib I think it’ll work.


soegaard2
2022-7-25 14:03:16

Hmm. I think the issue is that I am using raco pkg wrong. The folder pyffi has subfolders" pyffi/ pyffi/ pyffi-lib/ pyffi-doc/ The root folder pyffi/ holds thre packages.

But the error mentions pyffi/main.rkt instead of pyffi/pyffi/main.rkt to it suggest that my system thinks the root folder is a collection.


sorawee
2022-7-25 14:04:06

I would raco pkg remove pyffi and only raco pkg install ./pyffi-lib.


sorawee
2022-7-25 14:04:31

pyffi and pyffi-doc are not important for testing the functionality.


soegaard2
2022-7-25 14:06:03

% raco84 pkg install ./pyffi-lib The following uninstalled packages are listed as dependencies of pyffi-lib: pyffi


sorawee
2022-7-25 14:06:42

You should not have pyffi as a dependency of pyffi-lib, no?


sorawee
2022-7-25 14:06:55

I’m confused


sorawee
2022-7-25 14:07:17

I thought pyffi is like a dummy package that would install pyffi-lib, pyffi-doc, etc.


soegaard2
2022-7-25 14:07:44

You are not confused. I did have “pyffi” as a dependency.


soegaard2
2022-7-25 14:08:42

Yep. Now it works!

Thanks so much for the help.


soegaard2
2022-7-25 14:25:19

I need an raco pkg install-multi folder/ feature :slightly_smiling_face:


sorawee
2022-7-25 14:28:33

I think raco pkg install folder/*/ would work


sorawee
2022-7-25 14:28:46

assuming you use a shell that has * expansion.


soegaard2
2022-7-25 14:29:19

Maybe - but if I can’t find it by scanning raco pkg install --help I won’t see it.


samdphillips
2022-7-25 16:31:43

If the package names look like a local paths (which ./folder/* will do) then raco pkg install will link them all.


spdegabrielle
2022-7-25 17:10:47

*Summer #lang party 8pm UTC on Racket Discord

I’ll continue my journey working through chapter 17 of the Racket Guide Creating Languages https://docs.racket-lang.org/guide/languages.html\|https://docs.racket-lang.org/guide/languages.html

Event invite link <https://discord.gg/9Ed2tEzG?event=1001171820671680593\|https://discord.gg/9Ed2tEzG?event=1001171820671680593>

Or go to #streaming on <https://discord.gg/M7QsjTUfsd|Racket Discord>

UTC, Time Zone Mon, 25 Jul 2022 at 20:00 undefined Pacific Time, PT Mon, 25 Jul 2022 at 13:00 PDT Mountain Time, MT Mon, 25 Jul 2022 at 14:00 MDT Central Time, CT Mon, 25 Jul 2022 at 15:00 CDT Eastern Time, ET Mon, 25 Jul 2022 at 16:00 EDT London, United Kingdom Mon, 25 Jul 2022 at 21:00 BST Central European Summer Time, CEST Mon, 25 Jul 2022 at 22:00 CEST Taipei, Taiwan Tue, 26 Jul 2022 at 04:00 CST https://www.timeanddate.com/worldclock/converter.html?iso=20220725T200000&amp;p1=1440&amp;p2=tz_pt&amp;p3=tz_mt&amp;p4=tz_ct&amp;p5=tz_et&amp;p6=136&amp;p7=tz_cest&amp;p8=241*\|https://www.timeanddate.com/worldclock/converter.html?iso=20220725T200000&amp;p1=1440&amp;p2=tz_pt&amp;p3=tz_mt&amp;p4=tz_ct&amp;p5=tz_et&amp;p6=136&amp;p7=tz_cest&amp;p8=241*


ajmorgan
2022-7-25 20:43:19

@ajmorgan has joined the channel