Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: disallow version overwrites by policy #86

Merged
merged 3 commits into from Jan 2, 2018

Conversation

Projects
None yet
2 participants
@emauton
Copy link
Contributor

emauton commented Oct 2, 2017

Prior to this change, re-uploading a package with the same version
results in the old version being overwritten.

In some environments (e.g. with packages being automatically uploaded
from "green" builds of master), this can result in programmer error -
forgetting to change setup.py versions - changing the "version of
record" in the local pyshop.

This change add a new administrative policy option

pyshop.upload.never_overwrite

which results in re-uploads raising a HTTP Conflict Error.

This change also introduces pyfakefs to test cases, which means that
they no longer rely upon real /tmp or have filesystem dependencies
across tests.

Feature: disallow version overwrites by policy
Prior to this change, re-uploading a package with the same version
results in the old version being overwritten.

In some environments (e.g. with packages being automatically uploaded
from "green" builds of `master`), this can result in programmer error -
forgetting to change `setup.py` versions - changing the "version of
record" in the local `pyshop`.

This change add a new administrative policy option

    pyshop.upload.never_overwrite

which results in re-uploads raising a HTTP Conflict Error.

This change also introduces `pyfakefs` to test cases, which means that
they no longer rely upon real `/tmp` or have filesystem dependencies
across tests.
@emauton

This comment has been minimized.

Copy link
Contributor Author

emauton commented Oct 2, 2017

Just finishing up for the day. Any thoughts on the PR appreciated, and I'll take a look at the Travis errors in the morning. Thanks!

@mardiros

This comment has been minimized.

Copy link
Owner

mardiros commented Oct 5, 2017

It seems that you have broken the tests suite ?

@emauton

This comment has been minimized.

Copy link
Contributor Author

emauton commented Oct 5, 2017

Yes, I'm a little unclear on why pyfakefs is breaking under Travis but not under local virtualenvs, but I'll take a look today.

Add deps for non-PyPI pyfakefs
Travis runs using `nosetests`. While `python setup.py test` works fine,
something about interaction with `nose` is causing trouble for the 3.2
version of `pyfakefs` available on PyPI.

It seems 3.3 from `pyfakefs` Github works fine; opened an issue asking
about it at jmcgeheeiv/pyfakefs#304
@emauton

This comment has been minimized.

Copy link
Contributor Author

emauton commented Oct 5, 2017

I've cleared up the build problem with pyfakefs, but arguably in a less than ideal way. :o)

See notes at 675f924 and let me know what you think. Thanks!

@mardiros

This comment has been minimized.

Copy link
Owner

mardiros commented Oct 5, 2017

I like the idea of the setting to disallow override.

I didn't know about pyfakefs. I think we can wait a bit to know if its author release a new version of it
to avoid a git+http dependency.

The dependency has to be specified here :

https://github.com/mardiros/pyshop/blob/master/setup.py#L36

and must be a packaged version.

@emauton

This comment has been minimized.

Copy link
Contributor Author

emauton commented Oct 5, 2017

Yeah, funnily enough I'm working with pyshop precisely to stop using private git dependencies in my company's setup. :o)

I'll check back after we see what happens on jmcgeheeiv/pyfakefs#304.

Thanks!

Remove `git+https` deps for `pyfakefs`
No longer necessary as the latest `pyfakefs` has been pushed to PyPI per
  jmcgeheeiv/pyfakefs#304
@emauton

This comment has been minimized.

Copy link
Contributor Author

emauton commented Jan 2, 2018

Looks like we're good to go here with latest pyfakefs.

@mardiros mardiros merged commit b60cb1b into mardiros:master Jan 2, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@emauton emauton deleted the emauton:feature/overwrite_policy branch Jan 2, 2018

@emauton

This comment has been minimized.

Copy link
Contributor Author

emauton commented Jan 3, 2018

Neat, thanks for the merge & for pyshop. :o)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.