unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Python "src" layout not working correctly with pyproject-build-system
@ 2022-11-21 11:01 Reza Housseini
  2022-11-21 12:09 ` Wojtek Kosior via
  0 siblings, 1 reply; 4+ messages in thread
From: Reza Housseini @ 2022-11-21 11:01 UTC (permalink / raw)
  To: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 1820 bytes --]

Hi list

I'm packaging a project with pyproject-build-system which follows the 
src layout in python:

(define-public python-cfd-qsense
   (package
     (name "python-cfd-qsense")
     (version "d02178fc02cfef00d7fa0584d552614e9bdf4c5e")
     (source (origin
	      (method git-fetch)
	      (uri (git-reference
		    (url "https://gitlab.com/hsr-iet/wabesense/cfd_qsense.git")
		    (commit version)))
	      (file-name (git-file-name name version))
	      (sha256
	       (base32
		"1ys5my2kfsr5w94k619qrdjm5wa7j45z11dw2ib2ha0wpc85aw4x"))))
     (build-system pyproject-build-system)
     (arguments
      `(#:tests? #f ;; error in test suite
        #:phases
        (modify-phases %standard-phases
	 (replace 'check
	   (lambda* (#:key tests? #:allow-other-keys)
	     (when tests?
	       (invoke "python" "-m" "unittest")))))))
     (propagated-inputs (list
			python-numpy
			python-scipy
			python-matplotlib
			python-pyaml
			python-pandas
			python-numpy-stl
			python-coolprop))
     (home-page "https://gitlab.com/hsr-iet/wabesense/cfd_qsense")
     (synopsis
      "CFD simulation tool to produce pressure-discharge curve for water 
spring taps.")
     (description
      "CFD simulation tool to produce pressure-discharge curve for water 
spring taps.")
     (license license:gpl3)))

When inheriting from this package like so:

(package
   (inherit python-cfd-qsense)
   (source (local-file %source-dir #:recursive? #t)))))

it is no longer importable as module cfd_qsense instead I have to import 
src.cfd_qsense. Why is this behavior, when using the package as is 
everything works fine.

Thanks for any help.

Cheers,

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Python "src" layout not working correctly with pyproject-build-system
  2022-11-21 11:01 Python "src" layout not working correctly with pyproject-build-system Reza Housseini
@ 2022-11-21 12:09 ` Wojtek Kosior via
  2022-11-21 14:03   ` Reza Housseini
  0 siblings, 1 reply; 4+ messages in thread
From: Wojtek Kosior via @ 2022-11-21 12:09 UTC (permalink / raw)
  To: Reza Housseini; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

> Hi list
> 
> I'm packaging a project with pyproject-build-system which follows the 
> src layout in python [...]

Hi Reza,

Is the second snippet the content of a `guix.scm` you are adding inside
a git checkout of the project? Is %source-dir defined to the
checked-out directory?

Wojtek

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

Meet Kraków saints!           #18: blessed Józef Kowalski
Poznaj świętych krakowskich!  #18: błogosławiony Józef Kowalski
https://pl.wikipedia.org/wiki/Józef_Kowalski_(duchowny)
-- (sig_end)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Python "src" layout not working correctly with pyproject-build-system
  2022-11-21 12:09 ` Wojtek Kosior via
@ 2022-11-21 14:03   ` Reza Housseini
  2022-11-21 14:40     ` Wojtek Kosior via
  0 siblings, 1 reply; 4+ messages in thread
From: Reza Housseini @ 2022-11-21 14:03 UTC (permalink / raw)
  To: Wojtek Kosior; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 359 bytes --]

> Is the second snippet the content of a `guix.scm` you are adding inside
> a git checkout of the project? Is %source-dir defined to the
> checked-out directory?

Hi Wojtek
Yes, sorry for not clarifying that. The second snippet is a guix.scm 
inside the source code of python-cfd-qsense with the python module 
inside src/cfd_qsense.

Cheers,
Reza

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Python "src" layout not working correctly with pyproject-build-system
  2022-11-21 14:03   ` Reza Housseini
@ 2022-11-21 14:40     ` Wojtek Kosior via
  0 siblings, 0 replies; 4+ messages in thread
From: Wojtek Kosior via @ 2022-11-21 14:40 UTC (permalink / raw)
  To: Reza Housseini; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1336 bytes --]

> > Is the second snippet the content of a `guix.scm` you are adding inside
> > a git checkout of the project? Is %source-dir defined to the
> > checked-out directory?  
> 
> Hi Wojtek
> Yes, sorry for not clarifying that. The second snippet is a guix.scm 
> inside the source code of python-cfd-qsense with the python module 
> inside src/cfd_qsense.
> 
> Cheers,
> Reza

The most important thing that comes to mind is whether you're checked
out to the same commit that the original package definition used
(d02178fc02cfef00d7fa0584d552614e9bdf4c5e). If not, perhaps there's a
difference in e.g. setup.cfg between those commits?

I also know there are some build systems that behave differently when
run from git checkout and when run from a directory that does not
contain a `.git/` (which, I believe, is what `(method git-fetch)`
provides). I don't know if sole `setuptools.build_meta` (as used here)
is one of those, though.

Good luck :)

W.

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

Meet Kraków saints!           #32: blessed Anastazy Pankiewicz
Poznaj świętych krakowskich!  #32: błogosławiony Anastazy Pankiewicz
https://pl.wikipedia.org/wiki/Anastazy_Pankiewicz
-- (sig_end)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-21 14:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 11:01 Python "src" layout not working correctly with pyproject-build-system Reza Housseini
2022-11-21 12:09 ` Wojtek Kosior via
2022-11-21 14:03   ` Reza Housseini
2022-11-21 14:40     ` Wojtek Kosior via

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).