Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ '*' ]
pull_request:
branches: [ $default-branch ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: tox
run: tox
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog
=========
* 2.0.0
* Official supported Python versions changed to 3.10, 3.11, 3.12 and 3.13
* Removed test on invalid country codes in SSL certs, in line with the behaviour of the cryptography library
* Reinstated integration with readthedocs.io
* 1.3.1
* Ping edge case fix
* Add py37 testing
Expand Down
11 changes: 0 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ Better yet, make sure you get ujson and sphinx installed with it:

$ pip install ripe.atlas.sagan[fast,doc]

Troubleshooting
~~~~~~~~~~~~~~~

Some setups (like MacOS) have trouble with building the dependencies required
for reading SSL certificates. If you don't care about SSL stuff and only want to
use sagan to say, parse traceroute or DNS results, then you can do the following:

.. code:: bash

$ SAGAN_WITHOUT_SSL=1 pip install ripe.atlas.sagan

Quickstart: How To Use It
-------------------------

Expand Down
25 changes: 0 additions & 25 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,3 @@ you can always do that too. Simply un-tar the file and run the following in the
same directory as ``setup.py``.::

$ python setup.py install


.. _installation-troubleshooting:

Troubleshooting
---------------

Some setups (like MacOS) have trouble with building the dependencies required
for reading SSL certificates. If you don't care about SSL stuff and only want
to use sagan to say, parse traceroute or DNS results, then you can do the following:

$ SAGAN_WITHOUT_SSL=1 pip install ripe.atlas.sagan

More information can also be found `here`_.

If you *do* care about SSL and have to use a Mac, then `this issue`_ will likely
be of assistance. Essentially, you will need to uninstall Xcode (if it's
installed already), then attempt to use ``gcc``. This will trigger the OS to
ask if you want to install the Xcode compilation tools. Click ``install``, and
when that's finished, install Sagan with this command:

$ CFLAGS="-I/usr/include" pip install ripe.atlas.sagan

.. _here: https://cryptography.io/en/latest/installation/
.. _this issue: https://github.com/RIPE-NCC/ripe.atlas.sagan/issues/52
2 changes: 1 addition & 1 deletion ripe/atlas/sagan/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__version__ = "1.3.1"
__version__ = "2.0.0"
84 changes: 38 additions & 46 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from os.path import abspath, dirname, join
from setuptools import setup

__version__ = None
Expand All @@ -8,55 +9,46 @@
install_requires = [
"python-dateutil",
"pytz",
"cryptography",
]

tests_require = ["nose"]

if "SAGAN_WITHOUT_SSL" not in os.environ:
install_requires.append("cryptography")

# Allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

readme_path = os.path.join(os.path.dirname(__file__), "README.rst")
changelog_path = os.path.join(os.path.dirname(__file__), "CHANGES.rst")
# Get proper long description for package
current_dir = dirname(abspath(__file__))
description = open(join(current_dir, "README.rst")).read()
changes = open(join(current_dir, "CHANGES.rst")).read()
long_description = "\n\n".join([description, changes])

# Get the long description from README.md
with open(readme_path) as readme:
with open(changelog_path) as changelog:
setup(
name="ripe.atlas.sagan",
version=__version__,
packages=["ripe", "ripe.atlas", "ripe.atlas.sagan"],
namespace_packages=["ripe", "ripe.atlas"],
include_package_data=True,
license="GPLv3",
description="A parser for RIPE Atlas measurement results",
long_description="{readme}\n\n{changelog}".format(
readme=readme.read(),
changelog=changelog.read()
),
url="https://github.com/RIPE-NCC/ripe.atlas.sagan",
download_url="https://github.com/RIPE-NCC/ripe.atlas.sagan",
author="The RIPE Atlas Team",
author_email="atlas@ripe.net",
maintainer="The RIPE Atlas Team",
maintainer_email="atlas@ripe.net",
install_requires=install_requires,
tests_require=tests_require,
extras_require={
"fast": ["ujson"],
"doc": ["sphinx"]
},
test_suite="nose.collector",
classifiers=[
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Internet :: WWW/HTTP",
],
)
setup(
name="ripe.atlas.sagan",
version=__version__,
packages=["ripe", "ripe.atlas", "ripe.atlas.sagan"],
namespace_packages=["ripe", "ripe.atlas"],
include_package_data=True,
license="GPLv3",
description="A parser for RIPE Atlas measurement results",
long_description=long_description,
url="https://github.com/RIPE-NCC/ripe.atlas.sagan",
download_url="https://github.com/RIPE-NCC/ripe.atlas.sagan",
author="The RIPE Atlas Team",
author_email="atlas@ripe.net",
maintainer="The RIPE Atlas Team",
maintainer_email="atlas@ripe.net",
install_requires=install_requires,
extras_require={
"fast": ["ujson"],
"doc": ["sphinx"]
},
classifiers=[
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP",
],
)
22 changes: 0 additions & 22 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +0,0 @@
# Copyright (c) 2015 RIPE NCC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from .ping import *
from .traceroute import *
from .dns import *
from .ssl import *
from .http import *
from .ntp import *
from .wifi import *
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions tests/ssl.py → tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,3 @@ def test_ssl_x509_san():
{},
]
assert extensions == should_be


def test_invalid_country_code():
result = Result.get('{"af":4,"cert":["-----BEGIN CERTIFICATE-----\\nMIIENTCCAx2gAwIBAgIBADANBgkqhkiG9w0BAQUFADBzMQ8wDQYDVQQGEwZCcmF6\\naWwxCTAHBgNVBAgMADESMBAGA1UEBwwJU2FvIFBhdWxvMQ4wDAYDVQQKDAVJQ0FO\\nTjEOMAwGA1UECwwFTFJPT1QxITAfBgNVBAMMGGdydTAxLmwucm9vdC1zZXJ2ZXJz\\nLm9yZzAeFw0xNzA0MDMyMTU4MzlaFw0yNzA0MDEyMTU4MzlaMHMxDzANBgNVBAYT\\nBkJyYXppbDEJMAcGA1UECAwAMRIwEAYDVQQHDAlTYW8gUGF1bG8xDjAMBgNVBAoM\\nBUlDQU5OMQ4wDAYDVQQLDAVMUk9PVDEhMB8GA1UEAwwYZ3J1MDEubC5yb290LXNl\\ncnZlcnMub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuEHu8DoR\\nTlawVGz1bUyzFXpnnOVQwPQU9Z4q5auL74MTRizabE/6+V0Q3bfc3dLWOIY58WvX\\nq52Q81N1HynOZ5ZFYz+GMeeilxKJ4GlWQ22lYXBDobweCNhDEDQsh59AklzdyiWc\\n9g08THiaxFE85c3XlDzWCmlJGInZBZcml2VxQVEM8zrjqZXn/T3kUx8rej65q0v4\\nWEay02nrQxjUeFSRYx48WfgAz7S7LruLiPNO12pvVIpJro+MLzRrYD7f4Ba6pF8W\\nket/+nIAchbc+RjEyHyyE+hRmPfTDNARgZgSaEqB98tpav6k7Z7bijsIpwx6U4l6\\nYRxz3DIWKMe++QIDAQABo4HTMIHQMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE\\nFCwFtz6hwT4qsx5j0lUluDyXbJpBMIGdBgNVHSMEgZUwgZKAFCwFtz6hwT4qsx5j\\n0lUluDyXbJpBoXekdTBzMQ8wDQYDVQQGEwZCcmF6aWwxCTAHBgNVBAgMADESMBAG\\nA1UEBwwJU2FvIFBhdWxvMQ4wDAYDVQQKDAVJQ0FOTjEOMAwGA1UECwwFTFJPT1Qx\\nITAfBgNVBAMMGGdydTAxLmwucm9vdC1zZXJ2ZXJzLm9yZ4IBADANBgkqhkiG9w0B\\nAQUFAAOCAQEAVSqrE2xMOqOMT/0r0ijSJVJjMRtdd2WPnpFLZsIt5siHXZHitoF/\\nFLlgaDfWd70uVlL8EjGHxwKPJL2l8WU1foCKCHUA7syarvpQEpm3kaGAoPm8VPm8\\n/ZcjetBxvAF0ZImoAcNE66aanPRSCvcna/5ANgHyZp6a0i7DT/Tqd+/0U3PNZK0Z\\nI7K2HvWx8wgN9WnMwEcNDVw9/pvNpC4Uh4MNDXYJZeC1xMNlB3sfm/ohP15lPsxI\\nN2afNemOosSyqViiPCVl6HaEwrR7YZB2wffnMAC2RAkJYyRkv/V5L4Hf4xz3C+Bl\\n47GfJQP8dNoGhIt1iCtMQp1iRNUfYCuqhQ==\\n-----END CERTIFICATE-----"],"dst_addr":"199.7.83.80","dst_name":"199.7.83.80","dst_port":"443","from":"123.203.145.125","fw":4790,"group_id":1965073,"lts":54,"method":"TLS","msm_id":1965073,"msm_name":"SSLCert","prb_id":1004,"rt":701.811596,"src_addr":"192.168.1.100","timestamp":1502117346,"ttc":346.966342,"type":"sslcert","ver":"1.2"}')
assert(result.is_error)
print(type(result.error_message), result.error_message)
assert(result.error_message == "Country name must be a 2 character country code")
File renamed without changes.
File renamed without changes.
12 changes: 8 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[tox]
envlist=py27,py35,py36,py37
# commands=python setup.py test []
# deps=nose

[testenv]
commands=python setup.py test []
deps=nose
deps =
flake8
pytest
commands =
# flake8 --max-line-length=88 setup.py ripe/atlas/sagan/ tests/
pytest {posargs}