|
1 |
| -# Always prefer setuptools over distdictionaries |
2 |
| -from setuptools import setup, find_packages |
| 1 | +import setuptools |
| 2 | +import subprocess |
| 3 | +import os |
3 | 4 |
|
4 |
| -# Function to read the contents of a requirements file |
| 5 | +cf_remote_version = ( |
| 6 | + subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE) |
| 7 | + .stdout.decode("utf-8") |
| 8 | + .strip() |
| 9 | +) |
5 | 10 |
|
| 11 | +if "-" in cf_remote_version: |
| 12 | + # when not on tag, git describe outputs: "1.3.3-22-gdf81228" |
| 13 | + # pip has gotten strict with version numbers |
| 14 | + # so change it to: "1.3.3+22.git.gdf81228" |
| 15 | + # See: https://peps.python.org/pep-0440/#local-version-segments |
| 16 | + v,i,s = cf_remote_version.split("-") |
| 17 | + cf_remote_version = v + "+" + i + ".git." + s |
6 | 18 |
|
7 |
| -def load_requirements(filename): |
8 |
| - with open(filename, 'r', encoding='utf-8') as file: |
9 |
| - return file.read().splitlines() |
| 19 | +assert "-" not in cf_remote_version |
| 20 | +assert "." in cf_remote_version |
10 | 21 |
|
| 22 | +assert os.path.isfile("cf_remote/version.py") |
| 23 | +with open("cf_remote/VERSION", "w", encoding="utf-8") as fh: |
| 24 | + fh.write("%s\n" % cf_remote_version) |
11 | 25 |
|
12 |
| -prod_requirements = load_requirements('requirements.txt') |
13 |
| -dev_requirements = load_requirements('requirements-dev.txt') |
| 26 | +with open("README.md", "r", encoding="utf-8") as fh: |
| 27 | + long_description = fh.read() |
14 | 28 |
|
15 |
| -setup( |
16 |
| - name='scrapegraphai', |
17 |
| - version='0.1.0', # MAJOR.MINOR.PATCH |
18 |
| - description='A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines.', |
19 |
| - long_description=open('README.md', encoding='utf-8').read(), |
20 |
| - long_description_content_type='text/markdown', |
21 |
| - url='https://scrapegraph-ai.readthedocs.io/', |
22 |
| - author='Marco Vinciguerra', |
23 |
| - author_email='mvincig11@gmail.com', |
24 |
| - license='Apache 2.0', |
25 |
| - keywords='langchain, ai, artificial intelligence, gpt, machine learning, ml, nlp, natural language processing, openai, scraping, web scraping, web scraping library, web scraping tool, webscraping', |
| 29 | +setuptools.setup( |
| 30 | + name="cf-remote", |
| 31 | + version=cf_remote_version, |
| 32 | + author="Northern.tech, Inc.", |
| 33 | + author_email="contact@northern.tech", |
| 34 | + description="Tooling to deploy CFEngine (and much more)", |
| 35 | + long_description=long_description, |
| 36 | + long_description_content_type="text/markdown", |
| 37 | + url="https://github.com/cfengine/cf-remote", |
| 38 | + packages=setuptools.find_packages(), |
| 39 | + package_data={"cf_remote": ["VERSION"]}, |
| 40 | + include_package_data=True, |
26 | 41 | classifiers=[
|
27 |
| - 'Intended Audience :: Developers', |
28 |
| - 'License :: OSI Approved :: Apache Software License', |
29 |
| - 'Topic :: Software Development :: Scraping', |
30 |
| - 'Programming Language :: Python :: 3', |
31 |
| - 'Programming Language :: Python :: 3.9', |
32 |
| - 'Programming Language :: Python :: 3.10', |
33 |
| - 'Programming Language :: Python :: 3.11', |
34 |
| - 'Programming Language :: Python :: 3.12', |
35 |
| - 'Operating System :: OS Independent', |
| 42 | + "Programming Language :: Python :: 3", |
| 43 | + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", |
| 44 | + "Operating System :: OS Independent", |
| 45 | + ], |
| 46 | + python_requires=">=3.5", |
| 47 | + entry_points={"console_scripts": ["cf-remote = cf_remote.main:main"]}, |
| 48 | + install_requires=[ |
| 49 | + "apache-libcloud >= 3.3.1", |
36 | 50 | ],
|
37 |
| - packages=find_packages(), |
38 |
| - python_requires='>=3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*, !=3.8.*', |
39 |
| - include_package_data=True, |
40 |
| - # https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/ |
41 |
| - install_requires=prod_requirements, |
42 |
| - extras_require={ |
43 |
| - 'dev': prod_requirements + dev_requirements, |
44 |
| - }, |
45 | 51 | )
|
0 commit comments