* Bumping iPython by a minor version broke 3.6 installs for us via https://github.com/frappe/frappe/pull/14192 * We could just add another line in requirements.txt to solve this, but since PY36 is reaching end of life by end of this year and release of 3.10 is just around the corner, might as well just drop it now than later * Frappe v14 would probably have the support range of 3.7-3.10/11 given when we release it. Maintaining dependencies for such a large range can become cumbersome
61 lines
1.6 KiB
Python
61 lines
1.6 KiB
Python
# imports - standard imports
|
|
import os, shutil
|
|
from distutils.command.clean import clean as Clean
|
|
|
|
from setuptools import setup, find_packages
|
|
import re, ast
|
|
|
|
# get version from __version__ variable in frappe/__init__.py
|
|
_version_re = re.compile(r'__version__\s+=\s+(.*)')
|
|
|
|
with open('requirements.txt') as f:
|
|
install_requires = f.read().strip().split('\n')
|
|
|
|
with open('frappe/__init__.py', 'rb') as f:
|
|
version = str(ast.literal_eval(_version_re.search(
|
|
f.read().decode('utf-8')).group(1)))
|
|
|
|
class CleanCommand(Clean):
|
|
def run(self):
|
|
Clean.run(self)
|
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
for relpath in ['build', '.cache', '.coverage', 'dist', 'frappe.egg-info']:
|
|
abspath = os.path.join(basedir, relpath)
|
|
if os.path.exists(abspath):
|
|
if os.path.isfile(abspath):
|
|
os.remove(abspath)
|
|
else:
|
|
shutil.rmtree(abspath)
|
|
|
|
for dirpath, dirnames, filenames in os.walk(basedir):
|
|
for filename in filenames:
|
|
_, extension = os.path.splitext(filename)
|
|
if extension in ['.pyc']:
|
|
abspath = os.path.join(dirpath, filename)
|
|
os.remove(abspath)
|
|
for dirname in dirnames:
|
|
if dirname in ['__pycache__']:
|
|
abspath = os.path.join(dirpath, dirname)
|
|
shutil.rmtree(abspath)
|
|
|
|
setup(
|
|
name='frappe',
|
|
version=version,
|
|
description='Metadata driven, full-stack web framework',
|
|
author='Frappe Technologies',
|
|
author_email='info@frappe.io',
|
|
packages=find_packages(),
|
|
zip_safe=False,
|
|
include_package_data=True,
|
|
install_requires=install_requires,
|
|
dependency_links=[
|
|
'https://github.com/frappe/python-pdfkit.git#egg=pdfkit'
|
|
],
|
|
cmdclass = \
|
|
{
|
|
'clean': CleanCommand
|
|
},
|
|
python_requires='>=3.7'
|
|
)
|