Skip to content

Commit 0542ecc

Browse files
authored
Merge pull request #76 from RIPE-NCC/add_regions
Add regions support Fix sec issues
2 parents 1c97741 + 7e01661 commit 0542ecc

11 files changed

Lines changed: 41 additions & 28 deletions

File tree

.github/workflows/python-package-test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
python-version: ["3.10", "3.11", "3.12", "3.13"]
1919

2020
steps:
21-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
2222
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
@@ -35,17 +35,17 @@ jobs:
3535
runs-on: ubuntu-latest
3636
needs: test
3737
steps:
38-
- uses: actions/checkout@v5
38+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
3939
- name: Set up Python ${{ matrix.python-version }}
40-
uses: actions/setup-python@v5
40+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
4141
with:
4242
python-version: '3.11'
4343
- name: Build release
4444
run: |
4545
python -m pip install --upgrade build
4646
python -m build
4747
- name: Upload dist
48-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4949
with:
5050
name: release-dists
5151
path: dist/
@@ -56,13 +56,13 @@ jobs:
5656
needs: build
5757
steps:
5858
- name: Retrieve dist
59-
uses: actions/download-artifact@v5
59+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
6060
with:
6161
name: release-dists
6262
path: dist/
6363
- name: Push to test pypi
6464
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
65-
uses: pypa/gh-action-pypi-publish@release/v1.13
65+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1.13
6666
with:
6767
user: __token__
6868
password: ${{ secrets.PYPI_TEST_API_TOKEN }}

.github/workflows/python-package.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
python-version: ["3.10", "3.11", "3.12", "3.13"]
1919

2020
steps:
21-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
2222
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
@@ -35,17 +35,17 @@ jobs:
3535
runs-on: ubuntu-latest
3636
needs: test
3737
steps:
38-
- uses: actions/checkout@v5
38+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
3939
- name: Set up Python ${{ matrix.python-version }}
40-
uses: actions/setup-python@v5
40+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
4141
with:
4242
python-version: '3.11'
4343
- name: Build release
4444
run: |
4545
python -m pip install --upgrade build
4646
python -m build
4747
- name: Upload dist
48-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4949
with:
5050
name: release-dists
5151
path: dist/
@@ -56,13 +56,13 @@ jobs:
5656
needs: build
5757
steps:
5858
- name: Retrieve dist
59-
uses: actions/download-artifact@v5
59+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
6060
with:
6161
name: release-dists
6262
path: dist/
6363
- name: Push to pypi
6464
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
65-
uses: pypa/gh-action-pypi-publish@release/v1.13
65+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1.13
6666
with:
6767
user: __token__
6868
password: ${{ secrets.PYPI_API_TOKEN }}

CHANGES.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Releases History
22
================
33

4+
2.3.0 (release 2026-05-20)
5+
--------------------------
6+
New features:
7+
~~~~~~~~~~~~~
8+
- Add support for ``region`` and ``countries`` probe source types
9+
10+
Changes:
11+
~~~~~~~~
12+
- Pin GitHub Actions to full-length commit SHAs in CI workflows
13+
- Replace ``exec()``-based version loading with regex parsing
14+
- Upgrade requests to ~=2.34.2
15+
416
2.2.0 (release 2025-12-08)
517
--------------------------
618
Changes:

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
import os
1717

1818

19-
__version__ = None
20-
exec(open("../ripe/atlas/cousteau/version.py").read())
19+
import re
20+
with open("../ripe/atlas/cousteau/version.py") as _f:
21+
__version__ = re.search(r'^__version__\s*=\s*"([^"]+)"', _f.read()).group(1)
2122

2223
# If extensions (or modules to document with autodoc) are in another directory,
2324
# add these directories to sys.path here. If the directory is relative to the

docs/use.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Examples:
7171
Measurement Sources
7272
-------------------
7373
The second step is to create the measurements source(s). In order to do that you have to create an AtlasSource object using the arguments type, value, requested, and optionally tags.
74-
Type as described in the `API docs`_ should be one of the "area", "country", "prefix", "asn", "probes", "msm". Value is the actual value of the type and requested is the number of probes that will be selected from this source.
74+
Type as described in the `API docs`_ should be one of the "area", "country", "prefix", "asn", "probes", "msm", "region", "countries". Value is the actual value of the type and requested is the number of probes that will be selected from this source.
7575
Optionally you can use tags argument, which has to be a dictionary like {"include": [], "exclude": []}.
7676
Examples:
7777

ripe/atlas/cousteau/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class AtlasChangeRequest(AtlasRequest):
218218
"action": "add|remove",
219219
"requested": probe_number,
220220
# when action=remove only probes is supported
221-
"type": "area|country|asn|prefix|msm|probes",
221+
"type": "area|country|asn|prefix|msm|probes|region|countries",
222222
"value": probe_values
223223
}]
224224
"""

ripe/atlas/cousteau/source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AtlasSource(object):
3131
"""
3232

3333
# available types
34-
types_available = ["area", "country", "prefix", "asn", "probes", "msm"]
34+
types_available = ["area", "country", "prefix", "asn", "probes", "msm", "region", "countries"]
3535

3636
def __init__(self, **kwargs):
3737
if "requested" in kwargs:

ripe/atlas/cousteau/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# You should have received a copy of the GNU General Public License
1414
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515

16-
__version__ = "2.2.0"
16+
__version__ = "2.3.0"

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env python
2+
import re
23
from os.path import abspath, dirname, join
34
from setuptools import setup
45

5-
# import manually __version__ variable
6-
__version__ = None
7-
exec(open("ripe/atlas/cousteau/version.py").read())
6+
with open("ripe/atlas/cousteau/version.py") as _f:
7+
__version__ = re.search(r'^__version__\s*=\s*"([^"]+)"', _f.read()).group(1)
88

99
install_requires = [
1010
"python-dateutil",
11-
"requests~=2.32.0",
11+
"requests~=2.34.2",
1212
"websocket-client~=1.9.0",
1313
"typing-extensions",
1414
]

tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"type": {
5050
"type": "string",
5151
"enum": [
52-
"area", "country", "prefix", "asn", "probes", "msm"
52+
"area", "country", "prefix", "asn", "probes", "msm", "region", "countries"
5353
]
5454
},
5555
"value": {
@@ -98,7 +98,7 @@
9898
},
9999
"type": {
100100
"type": "string",
101-
"enum": ["area", "country", "prefix", "asn", "probes", "msm"]
101+
"enum": ["area", "country", "prefix", "asn", "probes", "msm", "region", "countries"]
102102
},
103103
"value": {
104104
"type": "string",

0 commit comments

Comments
 (0)