Skip to content

Python scraper based on AI

Update setup.py

Marco Vinciguerrae3b739ed70a7
diff --git a/setup.py b/setup.py
index 3f61b464..1a1a0cbc 100644
--- a/setup.py
+++ b/setup.py
@@ -1,45 +1,51 @@
-# Always prefer setuptools over distdictionaries
-from setuptools import setup, find_packages
+import setuptools
+import subprocess
+import os
-# Function to read the contents of a requirements file
+cf_remote_version = (
+ subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE)
+ .stdout.decode("utf-8")
+ .strip()
+)
+if "-" in cf_remote_version:
+ # when not on tag, git describe outputs: "1.3.3-22-gdf81228"
+ # pip has gotten strict with version numbers
+ # so change it to: "1.3.3+22.git.gdf81228"
+ # See: https://peps.python.org/pep-0440/#local-version-segments
+ v,i,s = cf_remote_version.split("-")
+ cf_remote_version = v + "+" + i + ".git." + s
-def load_requirements(filename):
- with open(filename, 'r', encoding='utf-8') as file:
- return file.read().splitlines()
+assert "-" not in cf_remote_version
+assert "." in cf_remote_version
+assert os.path.isfile("cf_remote/version.py")
+with open("cf_remote/VERSION", "w", encoding="utf-8") as fh:
+ fh.write("%s\n" % cf_remote_version)
-prod_requirements = load_requirements('requirements.txt')
-dev_requirements = load_requirements('requirements-dev.txt')
+with open("README.md", "r", encoding="utf-8") as fh:
+ long_description = fh.read()
-setup(
- name='scrapegraphai',
- version='0.1.0', # MAJOR.MINOR.PATCH
- description='A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines.',
- long_description=open('README.md', encoding='utf-8').read(),
- long_description_content_type='text/markdown',
- url='https://scrapegraph-ai.readthedocs.io/',
- author='Marco Vinciguerra',
- author_email='[email protected]',
- license='Apache 2.0',
- keywords='langchain, ai, artificial intelligence, gpt, machine learning, ml, nlp, natural language processing, openai, scraping, web scraping, web scraping library, web scraping tool, webscraping',
+setuptools.setup(
+ name="cf-remote",
+ version=cf_remote_version,
+ author="Northern.tech, Inc.",
+ author_email="[email protected]",
+ description="Tooling to deploy CFEngine (and much more)",
+ long_description=long_description,
+ long_description_content_type="text/markdown",
+ url="https://github.com/cfengine/cf-remote",
+ packages=setuptools.find_packages(),
+ package_data={"cf_remote": ["VERSION"]},
+ include_package_data=True,
classifiers=[
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: Apache Software License',
- 'Topic :: Software Development :: Scraping',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3.10',
- 'Programming Language :: Python :: 3.11',
- 'Programming Language :: Python :: 3.12',
- 'Operating System :: OS Independent',
+ "Programming Language :: Python :: 3",
+ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
+ "Operating System :: OS Independent",
+ ],
+ python_requires=">=3.5",
+ entry_points={"console_scripts": ["cf-remote = cf_remote.main:main"]},
+ install_requires=[
+ "apache-libcloud >= 3.3.1",
],
- packages=find_packages(),
- python_requires='>=3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*, !=3.8.*',
- include_package_data=True,
- # https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/
- install_requires=prod_requirements,
- extras_require={
- 'dev': prod_requirements + dev_requirements,
- },
)