Suggestion to slightly simplify pypi ports
Mojca Miklavec
mojca at macports.org
Sun Jun 23 10:02:07 UTC 2019
On Sun, 23 Jun 2019 at 10:43, Joshua Root wrote:
> On 2019-6-23 17:52 , Mojca Miklavec wrote:
> > Hi,
> >
> > I would like to suggest providing simplification for the following four lines:
> >
> > name py-foo
> > version 1.2.3
> > master_sites pypi:[string index ${python.rootname} 0]/${python.rootname}
> > distname ${python.rootname}-${version}
> >
> > which could read like the following, for example to set all four lines:
> >
> > pypi.setup foo 2.3.1
>
> Please, no. Setup procs like this are an anti-pattern IMO, since they
> make what's actually happening much more opaque.
>
> The portgroup could easily set defaults for master_sites and distname
> without a setup proc.
OK, I'm sorry, I didn't get it that this was an anti-pattern, thanks
for explanation (to both you and Ryan).
I guess this then changes my question into: how could we get rid of
these two rows?
master_sites pypi:[string index ${python.rootname}
0]/${python.rootname}
distname ${python.rootname}-${version}
We still need to keep in mind that some ports might prefer to fetch
python modules from github for whatever reason, so it needs to keep
working in cases like those.
Maybe something along the lines of "python.use_pypi yes" which would
set the two?
Thank you,
Mojca
More information about the macports-dev
mailing list