-
Notifications
You must be signed in to change notification settings - Fork 159
/
setup.py
67 lines (58 loc) · 2.25 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# -*- coding: utf-8 -*-
from setuptools import setup
try: # Pour pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # For pip <= 9
from pip.req import parse_requirements
# Based on http://peterdowns.com/posts/first-time-with-pypi.html
__version__ = '0.1.2' # Should match with __init.py__
_NOM_PACKAGE = 'amazonscraper'
_URL_GITHUB = 'https://github.com/tducret/amazon-scraper-python'
_DESCRIPTION = 'Package to search for products on Amazon and extract \
some useful information (title, ratings, number of reviews)'
_MOTS_CLES = ['api', 'amazon', 'python', 'amazonscraper', 'parsing',
'python-wrapper', 'scraping', 'scraper', 'parser']
_SCRIPTS = ['amazon2csv.py']
# To delete here + 'scripts' dans setup()
# if no command is used in the package
install_reqs = parse_requirements('requirements.txt', session='hack')
try:
requirements = [str(ir.req) for ir in install_reqs]
except:
requirements = [str(ir.requirement) for ir in install_reqs]
setup(
name=_NOM_PACKAGE,
packages=[_NOM_PACKAGE],
package_data={},
scripts=_SCRIPTS,
version=__version__,
license='MIT',
platforms='Posix; MacOS X',
description=_DESCRIPTION,
long_description=_DESCRIPTION,
author='Thibault Ducret',
author_email='[email protected]',
url=_URL_GITHUB,
download_url='%s/tarball/%s' % (_URL_GITHUB, __version__),
keywords=_MOTS_CLES,
setup_requires=requirements,
install_requires=requirements,
classifiers=['Programming Language :: Python :: 3'],
python_requires='>=3',
tests_require=['pytest'],
)
# ------------------------------------------
# To upload a new version on pypi
# ------------------------------------------
# Make sure everything was pushed (with a git status)
# (or git commit --am "Comment" and git push)
# git tag 0.1.2 -m "Added image urls for each product"; git push --tags
# Do a generation test on the pypi test repository
# python3 setup.py sdist register -r pypitest
# Upload test of the package on the pypi test repository
# python3 setup.py sdist upload -r pypitest
# Upload of the package on the official pypi repository
# python3 setup.py sdist upload -r pypi
# If you need to delete a tag
# git push --delete origin VERSION
# git tag -d VERSION