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

Update README to reflect PyPI usage #201

Merged
merged 2 commits into from
Jul 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ containing a free-form question, two MCQs and one MRQ:
Installation
------------

Install the requirements into the Python virtual environment of your
`edx-platform` installation by running the following command from the
root folder:
You can install Problem Builder from [PyPI](https://pypi.org/project/xblock-problem-builder/)
using this command:

```bash
$ pip install -r requirements.txt
```
pip install xblock-problem-builder
Copy link
Member

@pomegranited pomegranited Jul 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradenmacdonald CC @jmbowman I get an error when I run this:

(venv) $ pip install xblock-problem-builder==3.1.3
Collecting xblock-problem-builder==3.1.3
  Using cached https://files.pythonhosted.org/packages/d5/5d/12eb466347984534705efceed7da59883df004a1ce71f4d04b9fa51f1191/xblock_problem_builder-3.1.3-py2-none-any.whl
Collecting XBlock (from xblock-problem-builder==3.1.3)
  Using cached https://files.pythonhosted.org/packages/71/8e/cd778ea775fee0badffa33cfaa908dbd341c06aaf73cc70d9b5d930b4925/XBlock-1.2.1.tar.gz
Collecting xblock-utils (from xblock-problem-builder==3.1.3)
  Could not find a version that satisfies the requirement xblock-utils (from xblock-problem-builder==3.1.3) (from versions: )
No matching distribution found for xblock-utils (from xblock-problem-builder==3.1.3)

And sure enough, pypi.org doesn't have an xblock-utils package as requested by setup.py, it's called xblock-openedx-utils instead!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pomegranited edX actually doesn't publish xblock-utils to PyPI. That seems to be something posted by Stanford years ago and it's out of date (v0.9.0 vs 1.1.1). It seems that edX installs xblock-utils from git

So I think for now we should just merge this anyways and consider it a non-pip-installable prereq. Any edx-platform virtualenv will already have xblock-utils installed anyways.

CC @jmbowman in case you have any input.

Copy link
Member

@pomegranited pomegranited Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradenmacdonald Huh, ok! So could we instead remove the install_requires reference to xblock-utils from setup.py?

Or change the docs to note that this should only be installed in an edx-platform virtualenv?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it is still a requirement, so I don't want to remove it. I have updated the README to explain that in 6d62e61

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(y)

```

For full details, see "Open edX Installation", below.

Usage
-----
Expand All @@ -53,8 +54,9 @@ See [Usage Instructions](doc/Usage.md)
Workbench installation and settings
-----------------------------------

Install to the workbench's virtualenv by running the following command from the
problem builder repo root:
For developers, you can install this XBlock into the XBlock SDK workbench's
virtualenv by running the following command from the problem builder repo
root:

```bash
pip install -r requirements.txt
Expand Down Expand Up @@ -161,24 +163,19 @@ version, with the exception of the following compatibility issues:
* `edx-platform` version `open-release/eucalyptus.2` and earlier must use
≤[v2.6.0](https://github.com/open-craft/problem-builder/tree/v2.6.0). See
[PR 128](https://github.com/open-craft/problem-builder/pull/128) for details.
* `edx-platform` version `named-release/dogwood.3` must use
* `edx-platform` version `named-release/dogwood.3` and earlier must use
[v2.0.0](https://github.com/open-craft/problem-builder/tree/v2.0.0).
* Otherwise, consult the `edx-platform/requirements/edx/edx-private.txt` file to see which revision was
used by [edx.org](https://edx.org) for your branch.

The `edx-platform` `master` branch will generally always be compatible with the most recent Problem Builder tag. See
[edx-private.txt](https://github.com/edx/edx-platform/blob/master/requirements/edx/edx-private.txt) for the version
[the EDXAPP_PRIVATE_REQUIREMENTS setting](https://github.com/edx/configuration/blob/master/playbooks/roles/edxapp/defaults/main.yml) for the version
currently installed on [edx.org](https://edx.org).

To install Problem Builder on an Open edX installation, choose the tag you wish to install, and run:
To install new versions of Problem Builder (v3.1.3+), use `pip install xblock-problem-builder` or specify a version using e.g. `pip install xblock-problem-builder==3.1.3`. To do this on Open edX could look like:

```bash
$ sudo -u edxapp -Hs
edxapp $ cd ~
edxapp $ source edxapp_env
edxapp $ TAG='v2.6.5' # example revision
edxapp $ pip install "git+https://github.com/open-craft/problem-builder.git@$TAG#egg=xblock-problem-builder==$TAG"
edxapp $ cd edx-platform
$ sudo -Hu edxapp bash
edxapp $ cd && . edxapp_env && . ./venvs/edxapp/bin/activate && cd edx-platform/
edxapp $ pip install xblock-problem-builder
edxapp $ ./manage.py lms migrate --settings=aws # or openstack, as appropriate
```

Expand All @@ -188,8 +185,27 @@ $ sudo /edx/bin/supervisorctl restart edxapp:
$ sudo /edx/bin/supervisorctl restart edxapp_workers:
```

To install old verions of Problem Builder (< v3.1.3) on an Open edX installation, choose the tag you wish to install, follow the above instructions but instead of the `pip install xblock-problem-builder` command, use:

```
TAG='v2.6.5' pip install "git+https://github.com/open-craft/problem-builder.git@$TAG#egg=xblock-problem-builder==$TAG"
```

Note that Problem Builder requires [xblock-utils](https://github.com/edx/xblock-utils).
If you are installing it into a virtualenv used by edx-platform, xblock-utils should
already be installed. But if you are installing it into another virtualenv, you may
need to first install xblock-utils manually (recent versions of it are not available
on PyPI so will not be automatically installed).

See [Usage Instructions](doc/Usage.md) for how to enable in Studio.

Publishing to PyPI
------------------

Whenever we tag a new version, e.g. `v3.1.3` and push it to GitHub, CircleCI will
build it and deploy it to PyPI automatically. For details on how this works, see
[this pull request](https://github.com/open-craft/problem-builder/pull/199).

License
-------

Expand Down