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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ updates:
directory: /
schedule:
interval: daily
cooldown:
default-days: 7
13 changes: 9 additions & 4 deletions .github/workflows/pip-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@ on:
schedule:
- cron: "0 12 * * *"

permissions: {}

jobs:
pip-audit:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.x"
# TODO: change to "3.x" once dependencies are updated
python-version: "3.10"

- name: Install project
run: |
Expand All @@ -31,7 +36,7 @@ jobs:


- name: Run pip-audit
uses: pypa/gh-action-pip-audit@v1.0.8
uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0
with:
virtual-environment: /tmp/pip-audit-env

65 changes: 47 additions & 18 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,60 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [published]
types:
- published

jobs:
deploy:
name: release

permissions: {}

runs-on: ubuntu-latest

jobs:
build:
name: Build distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.x'
# TODO: change to "3.x" once dependencies are updated
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
pip install setuptools wheel

- name: Build distributions
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

- name: Upload distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: distributions
path: dist/

publish:
name: Publish Python distributions to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/fluxture
needs: [build]
permissions:
# Used to sign the release's artifacts with sigstore-python.
# Used to publish to PyPI with Trusted Publishing.
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: distributions
path: dist/

- name: Publish distributions
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ on:
pull_request:
branches: [ master ]

permissions: {}

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
# TODO: add newer versions once dependencies are updated
python-version: ["3.10"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: GitHub Actions Security Analysis with zizmor 🌈

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

permissions: {}

jobs:
zizmor:
name: Run zizmor 🌈
runs-on: ubuntu-latest
permissions:
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
7 changes: 1 addition & 6 deletions fluxture/geolocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
from ipaddress import IPv6Address as PythonIPv6
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import Iterator, Optional, Tuple, Union

try:
from typing import Protocol
except ImportError:
from typing_extensions import Protocol
from typing import Iterator, Optional, Protocol, Tuple, Union

import geoip2.database
import great_circle_calculator.great_circle_calculator as gcc
Expand Down
7 changes: 1 addition & 6 deletions fluxture/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
from inspect import isabstract
from typing import Dict, Generic, Iterator
from typing import OrderedDict as OrderedDictType
from typing import Tuple, Type, TypeVar, Union

try:
from typing import Protocol, runtime_checkable
except ImportError:
from typing_extensions import Protocol, runtime_checkable
from typing import runtime_checkable, Protocol, Tuple, Type, TypeVar, Union


P = TypeVar("P")
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
author="Trail of Bits",
version="0.0.1",
packages=find_packages(exclude=["test"]),
python_requires=">=3.7",
python_requires=">=3.10",
install_requires=[
"fastkml~=0.11",
"geoip2~=4.1.0",
Expand All @@ -22,7 +22,6 @@
"shodan~=1.24.0",
"six>=1.5",
"tqdm>=4.48.0",
"typing_extensions~=4.2.0 ; python_version < '3.8'",
],
extras_require={"dev": ["flake8", "pytest", "twine"]},
entry_points={"console_scripts": ["fluxture = fluxture.__main__:main"]},
Expand Down