
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.

- Based on https://github.com/lexi-lambda/racket-collections/tree/master/collections-lib, I don’t think you need
(define collection "python")

- Your package is going to conflict with https://pkgs.racket-lang.org/package/python

info.rkt
requiresffi
, which is not yet registered

pyfii-tests
doesn’t exist

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.

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?

@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)

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

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

@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.

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

@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

I used raco84 pkg update pyffi/
after the changes.

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

But then python
is one of your deps
.

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?

In pyffi-lib
’s info.rkt

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
.

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

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.

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.

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.

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

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

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

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

I’m confused

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

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

Yep. Now it works!
Thanks so much for the help.

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

I think raco pkg install folder/*/
would work

assuming you use a shell that has *
expansion.

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

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

*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&p1=1440&p2=tz_pt&p3=tz_mt&p4=tz_ct&p5=tz_et&p6=136&p7=tz_cest&p8=241*\|https://www.timeanddate.com/worldclock/converter.html?iso=20220725T200000&p1=1440&p2=tz_pt&p3=tz_mt&p4=tz_ct&p5=tz_et&p6=136&p7=tz_cest&p8=241*

@ajmorgan has joined the channel