mirror of
https://github.com/bellingcat/vk-url-scraper.git
synced 2026-06-07 19:08:38 +03:00
67 lines
2.3 KiB
Python
67 lines
2.3 KiB
Python
from setuptools import find_packages, setup
|
|
|
|
|
|
def read_requirements(filename: str):
|
|
with open(filename) as requirements_file:
|
|
import re
|
|
|
|
def fix_url_dependencies(req: str) -> str:
|
|
"""Pip and setuptools disagree about how URL dependencies should be handled."""
|
|
m = re.match(
|
|
r"^(git\+)?(https|ssh)://(git@)?github\.com/([\w-]+)/(?P<name>[\w-]+)\.git", req
|
|
)
|
|
if m is None:
|
|
return req
|
|
else:
|
|
return f"{m.group('name')} @ {req}"
|
|
|
|
requirements = []
|
|
for line in requirements_file:
|
|
line = line.strip()
|
|
if line.startswith("#") or len(line) <= 0:
|
|
continue
|
|
requirements.append(fix_url_dependencies(line))
|
|
return requirements
|
|
|
|
|
|
# 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(
|
|
name="vk-url-scraper",
|
|
version=VERSION["VERSION"],
|
|
description="Scrape VK URLs to fetch info and media - python API or command line tool.",
|
|
long_description=open("README.md").read(),
|
|
long_description_content_type="text/markdown",
|
|
classifiers=[
|
|
"Intended Audience :: Developers",
|
|
"Intended Audience :: Science/Research",
|
|
"Development Status :: 3 - Alpha",
|
|
"License :: OSI Approved :: MIT License",
|
|
"Programming Language :: Python :: 3",
|
|
],
|
|
keywords=["scraper", "vk", "vkontakte", "vk-api", "media-downloader"],
|
|
project_urls={
|
|
"Code": "https://github.com/bellingcat/vk-url-scraper",
|
|
"Documentation": "https://vk-url-scraper.readthedocs.io/en/latest/",
|
|
},
|
|
author="Bellingcat",
|
|
author_email="tech@bellingcat.com",
|
|
license="MIT",
|
|
packages=find_packages(
|
|
exclude=["*.tests", "*.tests.*", "tests.*", "tests"],
|
|
),
|
|
package_data={"vk_url_scraper": ["py.typed"]},
|
|
install_requires=read_requirements("requirements.txt"),
|
|
extras_require={"dev": read_requirements("dev-requirements.txt")},
|
|
python_requires=">=3.10",
|
|
entry_points={
|
|
"console_scripts": [
|
|
"vk_url_scraper=vk_url_scraper.__main__:main",
|
|
],
|
|
},
|
|
)
|