Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Remove hard-coded python3.6 references #1173

Merged
merged 4 commits into from Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Expand Up @@ -8,7 +8,7 @@ filter:
- 'kytos/web-ui/*'
build:
environment:
python: 3.6.3
python: 3.6
postgresql: false
redis: false
dependencies:
Expand Down
7 changes: 4 additions & 3 deletions README.rst
Expand Up @@ -38,11 +38,12 @@ Just install docker from your package provider and run:
Installing
==========

We use Python 3.6, so you'll have to install it into your environment beforehand:
If you don't have Python 3 installed, please install it. Please make
sure that you're using ``python3.6`` or a later version:

.. code-block:: shell

$ apt-get install python3.6
$ apt install python3

Then, the first step is to clone *kytos* repository:

Expand All @@ -56,7 +57,7 @@ install procedure:
.. code-block:: shell

$ cd kytos
$ sudo python3.6 setup.py install
$ sudo python3 setup.py install

Configuring
===========
Expand Down
2 changes: 1 addition & 1 deletion bin/kytosd
@@ -1,4 +1,4 @@
#!/usr/bin/env python3.6
#!/usr/bin/env python3
"""Start Kytos SDN Platform core."""

from kytos.core import kytosd
Expand Down
11 changes: 6 additions & 5 deletions docs/admin/installing.rst
Expand Up @@ -5,8 +5,8 @@ Installing
Installing required dependencies
================================

We use Python 3.6, so in order to use this software please install it
into your environment beforehand. Note that an additional step is
Kytos requires at least Python 3.6, so in order to use this software please
install it into your environment beforehand. Note that an additional step is
needed for Ubuntu releases older than 16.10.


Expand All @@ -20,15 +20,16 @@ install Python 3.6 packages. To add this PPA, use the commands:

$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt update
$ sudo apt install python-pip python3.6

Required packages
=================

The required Ubuntu packages can be installed by:
The required Debian/Ubuntu packages can be installed by:

.. code-block:: bash

$ sudo apt install python-pip python3.6
$ sudo apt install python3-pip python3

Installing with pip
===================
Expand All @@ -38,7 +39,7 @@ previous steps, then:

.. code-block:: bash

$ pip install kytos kytos-utils
$ pip3 install kytos kytos-utils

This will install the Kytos server and client, and also their dependencies,
like the python-openflow library.
Expand Down
25 changes: 12 additions & 13 deletions docs/developer/hacking.rst
Expand Up @@ -50,19 +50,18 @@ html_cov/index.html``).
Pyenv
=====

Some distributions do not provide all python releases, specially the most
recent ones such as ``>= 3.6``. The easiest *pythonic* way to setup your python
environment with the correct python version and its dependencies is to use
|pyenv|_ and |venv|_. So, here we will guide you on how to install those tools
and use them.
Some distributions do not provide all Python releases. The easiest *pythonic*
way to setup your Python environment with the correct version and its
dependencies is to use |pyenv|_ and |venv|_. So, here we will guide you on how
to install those tools and use them.

The following steps are focusing on Debian-Like systems, so some tweaks may be
necessary for other distro based systems.
necessary for other Linux distributions.

On the end of this chapter there are also other reference links for you to
better understand this projects and tools.
better understand this project and its tools.

.. note:: If you already have python 3.6 installed, you do not need to follow
.. note:: If you already have Python 3.6+ installed, you do not need to follow
this chapter. In such cases you can go straightforward to our
:doc:`tutorial:napps/development_environment_setup` tutorial.

Expand Down Expand Up @@ -96,7 +95,7 @@ Now, to activate the environment you just need to run: ``pyenv activate kytos``
Long version
------------

Now the detailed/explained version.
Now the detailed version.

|pyenv_cbp|_ also recommends you to install some system tools to be able to
build python versions (we have added git to that list):
Expand Down Expand Up @@ -150,18 +149,18 @@ Now you have |pyenv|_ and |pyenv_venv|_ tools available to be used on your shell
installed it, you may need to run the commands on the shell or source your
.bashrc file.

Install python specific version
Install specific Python version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To install a specific version of python, such as 3.6.2, you just neeed to run:
To install a specific version of Python, such as 3.6.2, you just need to run:

.. code:: bash

$ pyenv install 3.6.2

Python community considers a best practice to use "virtual environments"
The Python community considers a best practice to use "virtual environments"
|venv|_ in order to avoid conflict between python dependencies among multiple
projects, and even project and system python libraries. So, you may want to
projects, and even project and system Python libraries. So, you may want to
create a |venv|_ for kytos by doing:

.. code:: bash
Expand Down
31 changes: 10 additions & 21 deletions docs/developer/setup_develop_environment.rst
Expand Up @@ -9,20 +9,8 @@ locally.
System Requirements
===================

Before create your development environment you need install some libraries to
support run `Python 3.6` packages and `git` commands.

Ubuntu Old releases
-------------------

If are you using an Ubuntu version less than 17.10 you need to add a PPA to
able to install Python 3.6 packages. This step is made running the command
below.

.. code-block:: shell

$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt update
Before creating your development environment you need to install some libraries
to support running `Python 3` packages and `git` commands.


Installing the required packages
Expand All @@ -33,7 +21,7 @@ command below.

.. code-block:: shell

$ sudo apt install git libpython3.6-dev python3.6 python3-venv
$ apt install git python3 python3-venv libpython3-dev
hdiogenes marked this conversation as resolved.
Show resolved Hide resolved


Setup a Virtual Environment
Expand All @@ -56,7 +44,7 @@ To create a new virtual environment named `kytos-environment` you will run:

.. code-block:: shell

$ python3.6 -m venv kytos-environment
$ python3 -m venv kytos-environment

After ran the command above a new folder named `kytos-environment` will be
created.
Expand Down Expand Up @@ -97,29 +85,30 @@ If you want to remove an existing virtualenv, just delete its folder

.. code-block:: shell

$ rm -rf kytos-environment
$ rm -vrf kytos-environment


Installing from Source
======================

To install the kytos from source you need follow the below steps.
To install kytos from source you need to follow the steps below.


Update the virtualenv
---------------------

First of all activate the virtual environment and update the pip package that
First activate the virtual environment and update the pip package that
is already installed in the virtualenv, with setuptools and wheel.

.. code-block:: shell

(kytos-environment) $ pip install --upgrade pip setuptools wheel

Download the kytos project from github
Download the Kytos project from github
--------------------------------------

First, you need to run the commands below to clone the python-openflow, kytos-utils and kytos projects locally.
Run the commands below to clone the python-openflow, kytos-utils and kytos
projects locally.

.. code-block:: shell

Expand Down
2 changes: 1 addition & 1 deletion kytos/core/kytosd.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python3.6
#!/usr/bin/env python3
"""Start Kytos SDN Platform core."""
import asyncio
import functools
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/test_core/test_logs.py
Expand Up @@ -161,8 +161,7 @@ def test_handler_filter(self):
LogManager.add_handler(handler)

# Message based on the log output that ends with traceback plaintext as
# seen in lib/python3.6/site-packages/werkzeug/serving.py:225 of
# Werkzeug==0.12.1
# seen in site-packages/werkzeug/serving.py:225 of Werkzeug==0.12.1
msg = "lorem ipsum KeyError: 'Session is disconnected'"
logger = logging.getLogger('werkzeug')
logger.setLevel(logging.ERROR)
Expand All @@ -178,8 +177,7 @@ def test_old_handler_filter():
already existed before importing the "logs" module.

Message based on the log output that ends with traceback plaintext as
seen in lib/python3.6/site-packages/werkzeug/serving.py:225 of
Werkzeug==0.12.1:
seen in site-packages/werkzeug/serving.py:225 of Werkzeug==0.12.1:

- logger name: werkzeug
- level: ERROR
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
@@ -1,6 +1,5 @@
[tox]
#envlist = py36,py37
envlist = py36
#envlist = py36,py38

[testenv]
whitelist_externals=
Expand Down