-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP: finish merging Kinto and Cliquet #1
base: merge-from-cliquet
Are you sure you want to change the base?
Conversation
All the tests are broken, of course.
This changes all the imports, strings that correspond to imports, and setting names. This does NOT touch the backwards-compatibility hack in the settings code that tries to backfill cliquet.setting with setting.
pytest assumes that testapp is a test. Rename the function to make_testapp to get around this.
Anything in kinto/ that isn't in kinto/tests/ has to have 100% coverage. That doesn't seem valuable to me. At the same time, we want to maintain a distinction between the "core" part of the library which people might build servers out of, and the non-core thing that people will just run. kinto/tests/core seems like a good compromise.
There's really only one thing here that's valuable, and that's the actual migrate command. Leave that around in case someone else wants it. The fact that kinto, the major cliquet application to date, doesn't use anything else here, suggests we don't need it. Perhaps we were keeping it around for the sake of having an example for other authors. In that case, the kinto script is probably sufficient.
We're going to have to release a major version anyhow. May as well get rid of this deprecated code.
We no longer need both; the settings are the same, and everything that was `cliquet` is now under `kinto`.
The name of the thing formerly known as Cliquet is now Kinto-Core. This isn't super ideal and another cleanup pass will be necessary on this documentation to make sure it makes sense. cliquet_fxa is still a real project so we maintain references to it. This doesn't touch any of the Sphinx configuration, which we'll have to merge with the Kinto doc config.
This commit covers all the "no-brainer" cases, like import names and config parameters.
|
Do you mind activating a travis build on your fork? |
Some flake8 errors:
|
We should deactivate the obligation of a 100% coverage for py27-raw because a lot of tests are skipped. |
Oh, but it seems like postgres tests are getting skipped on my machine during the py2.7 tests, so I'm not sure what you're seeing that's different. |
Yes I think it was because |
# 'kinto.paginate_by': 3.14, | ||
# } | ||
# with self.assertRaises(ValueError): | ||
# self.settings(settings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
desired ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this in because I didn't know what I was going to do with the settings prefix stuff. I've removed them from public settings, but haven't taken them out of this yet. I'm going to delete this particular block of code but leave the remainder of the test, which checks that kinto.setting
is the same as setting
. Good catch!
I see that there are some |
I think we're good! impressive work Ethan, congratz |
Thanks @leplatrem for the suggestion.
We removed prefixes from the "hello" view, which means this assertion is *definitely* meaningless. As for the prefixes on incoming settings, let's leave that as it's outside the scope of this PR.
I didn't want to go too crazy on rewriting docs, figuring that this PR would already be quite large. I'm happy to do it either as part of this PR or as a follow-up. |
@@ -139,10 +139,10 @@ def build_permissions_set(object_uri, unbound_permission, | |||
|
|||
|
|||
@implementer(IAuthorizationPolicy) | |||
class AuthorizationPolicy(cliquet_authorization.AuthorizationPolicy): | |||
class AuthorizationPolicy(core_authorization.AuthorizationPolicy): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from kinto import core
; then use core.authorization
elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea, but in order to make it work, I have to change it to
import kinto.core.authorization
from kinto import core
... because core.authorization
is only defined as a side-effect of importing kinto.core.authorization
. This is an unfortunate quirk of Python's import behavior. I don't think this is an improvement, and flake8
doesn't like it either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, it's a nitpick anyway!
This doesn't make sense any more.
Thanks everyone for your work on this. I propose the following steps:
Does it works for you? |
This is a prototype of what it might look like to merge Cliquet into Kinto. The actual merge itself is d1e4fec, which resolves conflicts in "shared" files like
requirements.txt
,Makefile
,setup.py
. This PR is about addressing the aftermath -- moving thecliquet
package tokinto.core
, moving thecliquet_docs
into somewhere in thedocs
tree, and removing some of the duplicated/unneeded code now that the two projects are again one.Overall highlights:
cliquet.foo
settings are nowkinto.foo
settingscliquet
becamekinto/core
, except forcliquet/tests
which becamekinto/tests/core
. This is necessary because everything inkinto
has to have 100% coverage, which shouldn't be necessary forkinto/core/tests
.kinto/core/scripts/cliquet.py
; keep only themigrate
function, which now lives inkinto/core/scripts.py
cliquet_docs
is nowdocs/core
and it is no longer copied to Kinto docsinitialize_cliquet
There are still references in this project to cliquet_fxa and cliquet_pusher, which I considered outside the scope of this PR, but I'm interested in ideas on how to deal with this without breaking master.
This PR is against the
merge-from-cliquet
branch, which may eventually hit master, but in the meantime allows us to explore what it would look like to merge the cliquet and kinto repositories without breaking master (thanks @leplatrem for the idea).