mirror of
https://github.com/bellingcat/geoclustering.git
synced 2026-06-12 21:48:30 +03:00
build dist
This commit is contained in:
59
.github/actions/setup-venv/action.yml
vendored
Normal file
59
.github/actions/setup-venv/action.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: Python virtualenv
|
||||||
|
description: Set up a Python virtual environment with caching
|
||||||
|
inputs:
|
||||||
|
python-version:
|
||||||
|
description: The Python version to use
|
||||||
|
required: true
|
||||||
|
cache-prefix:
|
||||||
|
description: Update this to invalidate the cache
|
||||||
|
required: true
|
||||||
|
default: v0
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
# install ffmpeg
|
||||||
|
sudo apt install ffmpeg
|
||||||
|
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
# Install prerequisites.
|
||||||
|
pip install --upgrade pip setuptools wheel virtualenv
|
||||||
|
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
# Get the exact Python version to use in the cache key.
|
||||||
|
echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
id: virtualenv-cache
|
||||||
|
with:
|
||||||
|
path: .venv
|
||||||
|
key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt', 'dev-requirements.txt') }}
|
||||||
|
|
||||||
|
- if: steps.virtualenv-cache.outputs.cache-hit != 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Set up virtual environment without cache hit.
|
||||||
|
test -d .venv || virtualenv -p $(which python) --copies --reset-app-data .venv
|
||||||
|
. .venv/bin/activate
|
||||||
|
pip install -e .[dev]
|
||||||
|
|
||||||
|
- if: steps.virtualenv-cache.outputs.cache-hit == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Set up virtual environment from cache hit.
|
||||||
|
. .venv/bin/activate
|
||||||
|
pip install --no-deps -e .[dev]
|
||||||
|
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
# Show environment info.
|
||||||
|
. .venv/bin/activate
|
||||||
|
echo "✓ Installed $(python --version) virtual environment to $(which python)"
|
||||||
51
.github/workflows/main.yml
vendored
51
.github/workflows/main.yml
vendored
@@ -17,15 +17,58 @@ on: [push]
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
# Change this to invalidate existing cache.
|
# Change this to invalidate existing cache.
|
||||||
|
CACHE_PREFIX: v0
|
||||||
PYTHONPATH: ./
|
PYTHONPATH: ./
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
checks:
|
checks:
|
||||||
name: Python ${{ matrix.python }} - ${{ matrix.task.name }}
|
name: Python ${{ matrix.python }} - ${{ matrix.task.name }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: [ubuntu-latest]
|
||||||
steps:
|
timeout-minutes: 15
|
||||||
- uses: actions/checkout@v3
|
strategy:
|
||||||
- uses: psf/black@stable
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python: ['3.7', '3.10']
|
||||||
|
# task: # --show-capture=no on purpose
|
||||||
|
# - name: Test
|
||||||
|
# run: |
|
||||||
|
# pytest --show-capture=no --color=yes tests/
|
||||||
|
|
||||||
|
include:
|
||||||
|
# - python: '3.10'
|
||||||
|
# task:
|
||||||
|
# name: Lint
|
||||||
|
# run: flake8 .
|
||||||
|
|
||||||
|
# - python: '3.10'
|
||||||
|
# task:
|
||||||
|
# name: Type check
|
||||||
|
# run: mypy .
|
||||||
|
|
||||||
|
- python: '3.10'
|
||||||
|
task:
|
||||||
|
name: Build
|
||||||
|
run: |
|
||||||
|
python setup.py check
|
||||||
|
python setup.py bdist_wheel sdist
|
||||||
|
|
||||||
|
- python: '3.10'
|
||||||
|
task:
|
||||||
|
name: Style
|
||||||
|
run: |
|
||||||
|
black --check .
|
||||||
|
|
||||||
|
# - python: '3.10'
|
||||||
|
# task:
|
||||||
|
# name: Docs
|
||||||
|
# run: cd docs && make html
|
||||||
|
|
||||||
|
# checks:
|
||||||
|
# name: Lint
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v3
|
||||||
|
# - uses: psf/black@stable
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
|
|||||||
23
setup.py
23
setup.py
@@ -1,12 +1,29 @@
|
|||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
|
# version.py defines the VERSION and VERSION_SHORT variables.
|
||||||
|
# We use exec here so we don't import cached_path whilst setting up.
|
||||||
|
VERSION = {} # type: ignore
|
||||||
|
with open("vk_url_scraper/version.py", "r") as version_file:
|
||||||
|
exec(version_file.read(), VERSION)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="geocluster",
|
name="geocluster",
|
||||||
version="0.1",
|
version=VERSION["VERSION"],
|
||||||
description="",
|
description="📍 command-line tool for clustering geolocations.",
|
||||||
|
long_description=open("README.md").read(),
|
||||||
|
long_description_content_type="text/markdown",
|
||||||
|
classifiers=[
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
"Intended Audience :: Science/Research",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
],
|
||||||
author="Bellingcat",
|
author="Bellingcat",
|
||||||
|
author_email="tech@bellingcat.com",
|
||||||
|
license="MIT",
|
||||||
packages=["geocluster"],
|
packages=["geocluster"],
|
||||||
entry_points={"console_scripts": ["geocluster = geocluster.cli:main"]},
|
keywords=["cluster", "gis", "pattern-analysis"],
|
||||||
|
entry_points={"console_scripts": ["geocluster = geocluster.__main__:main"]},
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"click",
|
"click",
|
||||||
"geojson",
|
"geojson",
|
||||||
|
|||||||
Reference in New Issue
Block a user