Skip to content

Commit fa57110

Browse files
committed
reduced python version to 3.6 and updated quickstart
1 parent 4597f25 commit fa57110

File tree

2 files changed

+77
-39
lines changed

2 files changed

+77
-39
lines changed

docs/source/quickstart.rst

Lines changed: 75 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,95 @@ Quickstart
55
This doc is meant to serve as a quick-guide to setup RISCV-CONFIG and perform a \
66
sample validation of target specifications.
77

8-
Install Python Dependencies
9-
===========================
8+
Install Python
9+
==============
1010

11-
RISCV-CONFIG requires `pip` and `python` (>=3.7) to be available on your system. If you have issues
12-
installing either of these directly on your system, we suggest using a virtual environment
13-
like `pyenv` to make things easy.
11+
RISCV-CONFIG requires `pip` and `python` (>=3.6) to be available on your system.
1412

15-
Installing Pyenv [optional]
16-
---------------------------
13+
Ubuntu
14+
------
1715

18-
If you are working on Ubuntu/Debian systems make sure you have the following libraries installed:
16+
Ubuntu 17.10 and 18.04 by default come with python-3.6.9 which is sufficient for using riscv-config.
1917

20-
.. code-block:: bash
18+
If you are are Ubuntu 16.10 and 17.04 you can directly install python3.6 using the Universe
19+
repository::
2120

22-
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
23-
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
24-
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
21+
$ sudo apt-get install python3.6
22+
$ pip3 install --upgrade pip
2523

26-
Download and install pyenv:
24+
If you are using Ubuntu 14.04 or 16.04 you need to get python3.6 from a Personal Package Archive
25+
(PPA)::
2726

28-
.. code-block:: bash
27+
$ sudo add-apt-repository ppa:deadsnakes/ppa
28+
$ sudo apt-get update
29+
$ sudo apt-get install python3.6 -y
30+
$ pip3 install --upgrade pip
2931

30-
$ curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
32+
You should now have 2 binaries: ``python3`` and ``pip3`` available in your $PATH.
33+
You can check the versions as below::
3134

32-
Add the following lines to your .bashrc:
35+
$ python3 --version
36+
Python 3.6.9
37+
$ pip3 --version
38+
pip 20.1 from <user-path>.local/lib/python3.6/site-packages/pip (python 3.6)
3339

34-
.. code-block:: bash
40+
Centos:7
41+
--------
42+
The CentOS 7 Linux distribution includes Python 2 by default. However, as of CentOS 7.7, Python 3
43+
is available in the base package repository which can be installed using the following commands::
3544

36-
$ export PATH="/home/<username>/.pyenv/bin:$PATH"
37-
$ eval "$(pyenv init -)"
38-
$ eval "$(pyenv virtualenv-init -)"
45+
$ sudo yum update -y
46+
$ sudo yum install -y python3
47+
$ pip3 install --upgrade pip
3948

40-
Open a new terminal and create a virtual environment using the following
49+
For versions prior to 7.7 you can install python3.6 using third-party repositories, such as the
50+
IUS repository::
4151

42-
.. code-block:: bash
52+
$ sudo yum update -y
53+
$ sudo yum install yum-utils
54+
$ sudo yum install https://centos7.iuscommunity.org/ius-release.rpm
55+
$ sudo yum install python36u
56+
$ pip3 install --upgrade pip
4357

44-
$ pyenv install 3.7.0
45-
$ pyenv virtualenv 3.7.0 riscv_config_env
58+
You can check the versions::
4659

60+
$ python3 --version
61+
Python 3.6.8
62+
$ pip --version
63+
pip 20.1 from <user-path>.local/lib/python3.6/site-packages/pip (python 3.6)
4764

48-
Now you can activate this virtual environment using the following command:
4965

50-
.. code-block:: bash
66+
Using Virtualenv for Python
67+
---------------------------
68+
69+
Many a times folks face issues in installing and managing python versions, which is actually a
70+
major issue as many gui elements in Linux use the default python versions. In which case installing
71+
python3.6 using the above methods might break other software. We thus advise the use of **pyenv** to
72+
install python3.6.
73+
74+
For Ubuntu and CentosOS, please follow the steps here: https://github.com/pyenv/pyenv#basic-github-checkout
75+
76+
RHEL users can find more detailed guides for virtual-env here: https://developers.redhat.com/blog/2018/08/13/install-python3-rhel/#create-env
77+
78+
Once you have pyenv installed do the following to install python 3.6.0::
79+
80+
$ pyenv install 3.6.0
81+
$ pip3 install --upgrade pip
82+
$ pyenv shell 3.6.0
83+
84+
You can check the version in the **same shell**::
5185

52-
$ pyenv activate riscv_config_env
5386
$ python --version
87+
Python 3.6.0
88+
$ pip --version
89+
pip 20.1 from <user-path>.local/lib/python3.6/site-packages/pip (python 3.6)
5490

55-
Install via PIP [users]
56-
=======================
5791

58-
**NOTE**: If you are using `pyenv` as mentioned above, make sure to enable that environment before
59-
performing the following steps.
92+
Install RISCV-CONFIG
93+
====================
94+
95+
.. note:: If you are using a virtual environment make sure to enable that environment before
96+
performing the following steps.
6097

6198
.. code-block:: bash
6299
@@ -74,9 +111,8 @@ To checkout a specific version of riscv_config:
74111
75112
$ pip install riscv_config--1.x.x
76113
77-
Once you have RISCV_CONFIG installed, executing ``riscv_config --help`` should print the following on the terminal:
78-
79-
.. code-block:: bash
114+
Once you have RISCV_CONFIG installed, executing ``riscv_config --help`` should print the following
115+
output ::
80116

81117
riscv_config [-h] [--version] [--isa_spec YAML] [--platform_spec YAML]
82118
[--work_dir DIR] [--verbose]
@@ -96,9 +132,11 @@ Once you have RISCV_CONFIG installed, executing ``riscv_config --help`` should p
96132
RISCV_CONFIG for Developers
97133
===========================
98134

99-
Clone the repository from git and install required dependencies. Note, you will still need
100-
python-3.7.0 and pip. If you are using `pyenv` as mentioned above, make sure to enable that environment before
101-
performing the following steps.
135+
Clone the repository from git and install required dependencies.
136+
137+
.. note:: you will still need python-3.7.0 and pip.
138+
If you are using `pyenv` as mentioned above, make sure to enable that environment before
139+
performing the following steps.
102140

103141
.. code-block:: bash
104142

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def read(*parts):
2323
description="RISC-V Configuration Validator",
2424
long_description=long_description,
2525
classifiers=[
26-
"Programming Language :: Python :: 3.7",
26+
"Programming Language :: Python :: 3.6",
2727
"License :: OSI Approved :: BSD License",
2828
"Development Status :: 4 - Beta"
2929
],
@@ -36,7 +36,7 @@ def read(*parts):
3636
package_dir={'riscv_config': 'riscv_config/'},
3737
package_data={'riscv_config': ['schemas/*']},
3838
install_requires=['Cerberus>=1.3.1', 'ruamel.yaml>=0.16.0'],
39-
python_requires=">=3.7.0",
39+
python_requires=">=3.6.0",
4040
entry_points={
4141
"console_scripts": ["riscv-config=riscv_config.main:main"],
4242
})

0 commit comments

Comments
 (0)