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

Supported Python versions 3.3 to 3.13 #269

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ language: python
os: linux
dist: xenial
python:
- "2.7"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "pypy3.5"
install:
- pip install .
- pip install -r test_requirements.txt
- pip install --requirement test_requirements.txt
script:
- make tests
- make cov
Expand Down
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM alpine:edge
MAINTAINER rubik
LABEL maintainer="rubik"

WORKDIR /usr/src/app
COPY . /usr/src/app

RUN apk --update add \
python2 python3 py2-pip && \
pip2 install --upgrade pip && \
pip2 install --requirement requirements.txt && \
pip2 install . && \
mv /usr/bin/radon /usr/bin/radon2 && \
python3 py3-pip && \
pip3 install --requirement requirements.txt && \
pip3 install . && \
mv /usr/bin/radon /usr/bin/radon3 && \
Expand Down
17 changes: 8 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@ Radon can compute:
Requirements
------------

Radon will run from **Python 2.7** to **Python 3.12** (except Python versions
from 3.0 to 3.3) with a single code base and without the need of tools like
2to3 or six. It can also run on **PyPy** without any problems (currently PyPy
3.5 v7.3.1 is used in tests).
Radon will run with **Python versions 3.3 to 3.13**; and through
**PyPy** (currently PyPy 3.5 v7.3.1 is used in tests).

Radon depends on as few packages as possible. Currently only `mando` is
strictly required (for the CLI interface). `colorama` is also listed as a
dependency but if Radon cannot import it, the output simply will not be
colored.

**Note**:
**Python 2.6** was supported until version 1.5.0. Starting from version 2.0, it
is not supported anymore.
**Python 2** support was dropped in v6.0.0.

Installation
------------
Expand All @@ -54,7 +51,7 @@ With Pip:
$ pip install radon

If you want to configure Radon from `pyproject.toml` and you run Python <3.11,
you'll need the extra `toml` dependency:
you will need to install the extra `toml` dependency:

.. code-block:: sh

Expand Down Expand Up @@ -162,9 +159,11 @@ Usage with Jupyter Notebooks

Radon can be used with ``.ipynb`` files to inspect code metrics for Python cells. Any ``%`` macros will be ignored in the metrics.

.. note::
You will need to install the extra `notebook` dependency:

Jupyter Notebook support requires the optional ``nbformat`` package. To install, run ``pip install nbformat``.
.. code-block:: sh

$ pip install radon[notebook]

To enable scanning of Jupyter notebooks, add the ``--include-ipynb`` flag.

Expand Down
6 changes: 2 additions & 4 deletions codeclimate-radon
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ if os.path.exists("/config.json"):

if config["config"].get("python_version"):
version = config["config"].get("python_version")
if version == "2" or version == 2:
binstub = "radon2"
elif version != "3" and version != 3:
sys.exit("Invalid python_version; must be either 2 or 3")
if version != "3" and version != 3:
sys.exit("Invalid python_version; must be version 3")
if config["config"].get("encoding"):
encoding = config["config"].get("encoding")
os.environ["RADONFILESENCODING"] = encoding
Expand Down
6 changes: 4 additions & 2 deletions docs/commandline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ Usage with Jupyter Notebooks

Radon can be used with ``.ipynb`` files to inspect code metrics for Python cells. Any ``%`` macros will be ignored in the metrics.

.. note::
You will need to install the extra `notebook` dependency:

.. code-block:: sh

Jupyter Notebook support requires the optional ``nbformat`` package. To install, run ``pip install nbformat``.
$ pip install radon[notebook]

To enable scanning of Jupyter notebooks, add the ``--include-ipynb`` flag with any of the commands.

Expand Down
18 changes: 8 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
#
# Radon documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 11 16:08:21 2012.
#
Expand Down Expand Up @@ -46,9 +44,9 @@
master_doc = 'index'

# General information about the project.
project = u'Radon'
project = 'Radon'
build_date = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
copyright = u'{0}, Michele Lacchia'.format('-'.join(map(str,
copyright = '{0}, Michele Lacchia'.format('-'.join(map(str,
range(2012,
build_date.year + 1))))

Expand Down Expand Up @@ -193,8 +191,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Radon.tex', u'Radon Documentation',
u'Michele Lacchia', 'manual'),
('index', 'Radon.tex', 'Radon Documentation',
'Michele Lacchia', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -223,8 +221,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'radon', u'Radon Documentation',
[u'Michele Lacchia'], 1)
('index', 'radon', 'Radon Documentation',
['Michele Lacchia'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -237,8 +235,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Radon', u'Radon Documentation',
u'Michele Lacchia', 'Radon', 'One line description of project.',
('index', 'Radon', 'Radon Documentation',
'Michele Lacchia', 'Radon', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
21 changes: 6 additions & 15 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,22 @@
Welcome to Radon's documentation!
=================================

.. image:: http://img.shields.io/travis/rubik/radon/master.svg?style=flat
:alt: Travis-CI badge
:target: https://travis-ci.org/rubik/radon
.. image:: https://img.shields.io/pypi/v/radon
:alt: PyPI latest version badge
:target: https://pypi.python.org/pypi/radon

.. image:: http://img.shields.io/coveralls/rubik/radon/master.svg?style=flat
:alt: Coveralls badge
:target: https://coveralls.io/r/rubik/radon?branch=master

.. image:: https://pypip.in/v/radon/badge.png?style=flat
:alt: PyPI latest version badge
.. image:: https://static.pepy.tech/personalized-badge/radon?units=abbreviation&period=total&left_color=grey&right_color=blue&left_text=downloads
:alt: PyPI downloads
:target: https://pypi.python.org/pypi/radon

.. image:: https://pypip.in/d/radon/badge.png?style=flat
:alt: PyPI downloads badge
:target: https://pypi.python.org/pypi/radon

.. image:: https://pypip.in/format/radon/badge.svg?style=flat
:target: http://pythonwheels.com/
:alt: Download format

.. image:: https://pypip.in/license/radon/badge.png?style=flat
.. image:: https://img.shields.io/pypi/l/radon
:alt: Radon license
:target: https://pypi.python.org/pypi/radon


----

Radon is a Python tool which computes various code metrics. Supported metrics are:
Expand Down
Loading