How to install plone.restapi?

What is correct way to download plone.restapi?
I already downloaded the pip, but just leave the plone does not run anymore. Already added in buildout.cfg but did not work either.

1 Like

It would be useful for you to post more details: which version of Plone, the version of plone.restapi, the details of your buildout.cfg, and what specific error messages you are seeing.

This is a guide to adding add-ons to a Plone installation: https://docs.plone.org/manage/installing/installing_addons.html

You add plone.restapi as every other add-on to the eggs of your buildout configuration, re-run buildout and add it through the add-ons controlpanel...not different from most others add-ons.

-aj

It would still be nice to have an "Installation" toc entry.

Also, looks like plone5 is in conflict:

Getting distribution for 'plone.restapi'.
Got plone.restapi 3.4.2.
Getting distribution for 'PyJWT'.
... 
Got PyJWT 1.6.4.
Version and requirements information containing plone.schema:
  [versions] constraint on plone.schema: 1.0.0
  Requirement of plone.restapi: plone.schema>=1.2.0
While:
  Installing exportimport.
Error: The requirement ('plone.schema>=1.2.0') is not allowed by your [versions] constraint (1.0.0)

Is there a version pin that builds plone.restapi with Plone5?

Buildout is not that crazy - I just have a part named exportimport that does this:

[exportimport]
recipe = zc.recipe.egg
eggs = 
   plone.restapi

I'm wondering if I'm doing anything wrong here with my plone5 installation. I'm using http://dist.plone.org/release/5.0.5/versions.cfg and I'm hitting a lot of version conflicts that other people here seem to be working just fine.

Am I off the beam somewhere?

Plone 5.1.2
plone.restapi 3.4.2

Buildout.cfg is clean, I do the default installation of plone and then try to install plone.restapi.
I followed the steps in the add-in installation guide.
I added plone.restapi to eggs

eggs =
plone.restapi

and re-run buildout

I got those same mistakes

I add plone.restapi to buildout.cfg but when re-executing the buildout, it displays the following error

I just got it to build with 2.2.1 (just a guess) But I'll wait on someone more familliar with restapi to chime in here.

Obvliously it's not as easy as just adding plone.restapi to your buildout. We need a version pin also.

I added

[versions]
plone.restapi = 2.2.1

to my versions.cfg. You might just add it straight to your buildout.

I'll test fixing the version

You have to pin plone.schema to 1.2.0 to fix this issue.

Um, I'm not sure that's the best approach. It might work, but you've officially forked and updated Plone on your own system and gone your own direction.

Plone 5.x has been tested with plone.schema=1.0.0 and all other packages play nicely with that version.

If there is a new plone version that updates versions.cfg to 1.2.0 - yes, I'd use it, but until then, I'd use a plone.restapi version that "plays nice" with the current plone version.

pin plone.restapi to a version that works (I found 2.2.1 working, but a higher version may also work).

I fixed plone.restapi in version 2.2.1 and it worked without problems. Thank you!

plone.restapi requires plone.schema 1.2.0 and the only thing that we changed in comparison to plone.schema 1.0.0 is the new JSON field that we require. Using the word "fork" in that context is not accurate in my opinion. plone.schema 1.2.0 will become part of the next Plone 5 releases and might even get into 4.x to ease working with plone.restapi.

Your advice to stick with plone.restapi 2.2.1 instead will work. Though, I'd recommend to stick with the latest version. Especially when starting. Otherwise you risk having to put effort into adapting to breaking changes (that were introduced between plone.restapi 2.x and 3.x) for no good reason.

I understand that the latest version of the plone.restapi add-on is probably the best. But not at the risk of an untested Plone build.

However, my opinion, as a contributor to the plone collective and honoring a mission to make plone more accessible, is to pin plone.restapi to a version that is guaranteed to work with the current release of Plone.

I'm sure someone will fork plone, bump plone.schema to 1.2.0, run it through Jenkins, and issued a pull request if all tests pass. Then the current release will have plone.schema 1.2.0 and the current version of plone.restapi will work.

I don't believe in putting that burden on a user who is just trying to 'get it to work'

I'm not trying to be mean or rude. My view comes from a goal of "Higher Plone Adoption". Making it easy and error-free to install an add-on product is essential to plone adoption for the new user. This is the viewpoint I come from.

2 Likes

I left the plone.restapi in the latest version.
And in the versions.cfg file I changed the version of plone.schema to 1.2.0. It ran smoothly, can I leave like this or can this cause me problems?

Detail, I'm just testing the plone at this point but the intention is used in a large portal.

for testing and development, you are in the right state. You may find a problem.

If you deploy what you have to production, that's when the worries start. I would wait for a Plone 5 release that officially uses plone.schema 1.2.0 before going to a production environment. When a plone release is cut, it's tested with many many common add-ons, so you can feel confident you're not off the beaten path too much.

Thank you very much

1 Like

You are very welcome.

Understand that @tisto is the developer and maintainer of plone.restapi. If there is anyone here who can say it's safe to install the latest version and bump plone.schema to 1.2.0 for your Plone install, it's this guy.

I wouldn't do it in production, but I would definitely do it in a development build.