pypi2port: two files with the same content

Mojca Miklavec mojca at macports.org
Thu Feb 19 11:33:34 PST 2015


Dear Gaurav & others,

(I received Gaurav's response indirectly, so I'm just citing it below.)

On Thu, Feb 19, 2015 at 4:53 PM, Gaurav Bansal wrote:
> On Thu, Feb 19, 2015 at 12:12 AM, Mojca Miklavec wrote:
>> Hi,
>>
>> I wanted to try out pypi2port and stumbled across some trivial
>> problems which I started happily fixing until I realized that our
>> repository contains both pypi2port and pypi2port.py with exactly the
>> same content (apart from my clumsy commit which accidentally changed
>> just one of both files).
>>
>> I would like to fix my mistake, but I would like to know why we are
>> duplicating the code in the first place. Can one of the two files be
>> removed and symlinked from the other one? (And if so, which one?)
>>
>> Thank you,
>>     Mojca
>
> Hello,
>
> *pypi2port.py* is the main file. I created the *pypi2port* file just to
> make it as an executable and also to track the changes with just the last
> commit. The file "pypi2port" can be removed without any complications.

In that case I would suggest to delete it (and optionally replace it
with a symlink to the main file).

> Also, I changed the pypi2port.py file by making it more structured in my
> users directory
> https://svn.macports.org/repository/macports/users/gaurav/pypi2port/

Serious question: why are you making these changes in your user
directory? Unless they are (highly) experimental, it makes a lot more
sense if you merge those changes back to contrib and make further
commits simply in "contrib/pypi2port".

> Also, please let me know in which file did you made the changes so that I
> fix if there is some problem.

You can see the changes I did in
    https://trac.macports.org/log/contrib/pypi2port/pypi2port
I made three changes:
- added parenthesis to print arguments
- fixed the syntax for exceptions (one wrong commit and then the fix)
- removed python versions "25 26 32 33": these should no longer be
added to ports

I was optimistically trying to make the script work with Python 3.4,
but I later figured out that some packages were used that are no
longer present in Python 3, so one would need slightly more
fundamental changes than just a few parethesis.

So I have two suggestions:
- It would be great to create a Portfile, so that "port install
pypi2port" would automatically install the script to $prefix/bin,
similar to cpan2port.
- It would be nice (but not absolutely necessary) to support Python 3.

> Regards,
> Gaurav

Thank you,
    Mojca


More information about the macports-dev mailing list