Suggestion to slightly simplify pypi ports

Joshua Root jmr at macports.org
Mon Jun 24 14:13:24 UTC 2019


On 2019-6-24 23:55 , Ryan Schmidt wrote:
> 
> 
> On Jun 23, 2019, at 05:02, Mojca Miklavec wrote:
> 
>> 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?
> 
> I think that would be my recommendation, yes. The similar functionality in the php-1.1 portgroup (php.pecl yes) has been in place for years and works fine as far as I can tell (however most php modules are maintained by me, so it's possible that if there were many others maintaining php modules, their unique coding styles might reveal problems with this approach that I haven't encountered with my coding style). python.use_pypi would be an option, it would default to no, and you would add an option_proc to it (like php-1.1's php._set_pecl) so that when it is set to yes, it would set pypi-appropriate values for distname, master_sites, and the livecheck options. Maybe it should only set the *defaults* of those options, rather than setting the options themselves... but I see that in the php-1.1 portgroup I'm setting the values, not the defaults, and I don't remember if that was intentional. Oh well.

I don't see why a new option is needed. Using pypi master_sites is a
reasonable default, and master_sites and distname can be changed to
something else if needed.

- Josh


More information about the macports-dev mailing list