Giter Site home page Giter Site logo

python-toolchain's Introduction

Robot Framework Toolchain for Beginners

In order to start playing around with Robot Framework, Python needs to be installed. Also using an IDE with the correct plugins helps creating your Robot Framework code in many ways.

One issue with Mac OS: It has its own Python installation that is not always the version you need for your projects. Since Mac OS is dependent on the version it uses, you don't want to mess with that installation.

To fix this pyenv helps to install a separate (more up to date) version of Python alongside the one Mac OS uses and can be used without interfering.

So to get started with Robot Framework on a Mac you need the following tools:

  • Homebrew - The Missing Package Manager for macOS (or Linux)
  • pyenv - Simple Python version management
  • Visual Studio Code - IDE
    • robocorp.robotframework-lsp

Homebrew

Homebrew is a package management system with which you can install all kinds of applications or tools, here it is used to install pyenv and the tools needed to install python later on.

To install brew first install de CLT from xcode by running from the terminal [1]

xcode-select --install

Then to install brew itself [2]

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

It will guide you through the process and after some time you'll get the message:

==> Installation successful!

pyenv

pyenv can manage multiple versions of python next to each other.

  1. To install pyenv:
brew install pyenv
  1. Set up your shell environment for pyenv by running following code in the terminal [3]
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
  1. Add dependencies for building python from source as pyenv does:
brew install openssl readline sqlite3 xz zlib
  1. Open a new terminal window and check the installed versions of Python, it will look something like this
pyenv versions
  system
  3.8.13
  1. Install a recent version of python
pyenv install 3.11
Downloading Python-3.11.2.tar.xz...
-> https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tar.xz
Installing Python-3.11.2...
...
Installed Python-3.11.2 to /Users/myuser/.pyenv/versions/3.11.2
  1. Verify that the version is installed
pyenv versions
  system
  3.8.13
  3.11.2
  1. Set the version as the python to be used
pyenv global 3.11.2
  1. Check if the new version is now active
pyenv versions
  system
  3.8.13
* 3.11.2 (set by /Users/myuser/.pyenv/version)
  1. Check if the new version of python is active
python --version
Python 3.11.2

So now we have a working new version of python that is up to date and which we can use for Robot Framework.

Robot Framework

We can use the python package management system pip to install Robot Framework.

  1. Install Robotframework
pip install robotframework
Collecting robotframework
  Using cached robotframework-6.0.2-py3-none-any.whl (658 kB)
Installing collected packages: robotframework
Successfully installed robotframework-6.0.2
  1. Check if robot framework is correctly installed.
robot --version
Robot Framework 6.0.2 (Python 3.11.2 on darwin)

Visual Studio Code

Visual Studio Code can be installed

  1. through the installer from https://code.visualstudio.com or
  2. through brew
brew install --cask visual-studio-code

Install extensions for Robot Framework

  • from VSCode use cmd+shift+X and search for robotframework-lsp or
  • from the terminal
code --install-extensions robocorp.robotframework-lsp

Happy Testing!

python-toolchain's People

Contributors

guidodemmenie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.