ccpgames / pypackage

Tools to package python from static metadata
MIT License
25 stars 4 forks source link

Running `py-build -m` corrupted existing `pypackage.meta` #5

Closed Zearin closed 8 years ago

Zearin commented 8 years ago

I discovered this project this morning, and I am so excited to use it. I want it to be the normal way to package Python projects. But as the Issue title says: Running py-build -m corrupted my existing pypackage.meta.

Here’s what happened:

# pypackage.meta generated by `py-build -m` at 2016-04-11T16:20:56 UTC
{}

This should never happen!

I suggest following the behavior of NPM. Let’s say that I modified a package.json by hand. Then, I run an npm command to update the file.

There is never any data loss. My hand-coded changes might be reformatted (for example, if I used non-standard indentation)—but the change would persist (unless whatever npm command I ran was supposed to remove that change). More importantly, if npm couldn’t read package.json in the first place, it prints an error and leaves the file alone.

a-tal commented 8 years ago

For sure. that shouldn't of happened. Using py-build -m will remake your meta though, which will lose any extra comments that you've put in it. I've made it a fatal error if the meta exists and can't be read, which should only happen in the case of malformed JSON. Thanks for bringing this up, sorry it happened.

Zearin commented 8 years ago

No prob! I still had my editor open, and a quick Undo command restored my data. I had about 1.5 seconds of heart-wrenching panic when I first saw the wiped file content, though. ;)

a-tal commented 8 years ago

cool beans. I've made a 0.2.0 release that contains these changes. it should be uploaded by travis in a couple minutes. let me know if you run into anything else, and thanks again!

Zearin commented 8 years ago

Aside (unrelated to this issue) ☻

I just discovered another project, nppm, which behaves like npm for Python.

In many ways, I like that approach better, because:

However, that project has one major drawback:

I love the "no setup.py in the source; only in the distribution" philosophy. I love

I wonder if you two could collaborate? If you did, it could really bring Python packaging out of the dark ages into the modern era. NPM really hits all the right notes for package management; I feel no shame in advocating an approach imitate their conventions. :P

Zearin commented 8 years ago

cool beans. I've made a 0.2.0 release that contains these changes. it should be uploaded by travis in a couple minutes. let me know if you run into anything else, and thanks again!

Awesome! Thanks to you, too!