Skip to content

Update setup.py and requirements.txt for Python 3.12+ compatibility #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
Python SDK for UFACTORY robotic arm 850, xArm 5/6/7, and Lite6.
Python SDK for xArm Robotics (Supports Python 3.0+)

:Website: https://www.ufactory.cc/
:Github: https://github.com/xArm-Developer/xArm-Python-SDK
:Docs: http://docs.api.ufactory.cc
:Release Note: https://github.com/xArm-Developer/xArm-Python-SDK/blob/master/README.md#update-summary
:Bug Reports: [email protected]


Installation
------------
Run `pip install .` in the project root. Requires Python 3.0+.

Update Summary
--------------
- Add Python 3.0-3.12 compatibility:
- Updated `setup.py` with `setuptools`/`distutils` fallback.
- Added `setuptools` to `requirements.txt`.
- Tested on Python 3.5 locally.


1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setuptools>=0.6b1
61 changes: 18 additions & 43 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,34 @@
#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2017, UFactory, Inc.
# All rights reserved.
#
# BSD License (c) 2017, UFactory, Inc.
# Author: Vinman <[email protected]>

import os
from distutils.util import convert_path

# Prefer setuptools but fall back to distutils if needed
try:
from setuptools import setup, find_packages
from setuptools import setup
except ImportError:
from distutils.core import setup

def find_packages(base_path='.'):
base_path = convert_path(base_path)
found = []
for root, dirs, files in os.walk(base_path, followlinks=True):
dirs[:] = [d for d in dirs if d[0] != '.' and d not in ('ez_setup', '__pycache__')]
relpath = os.path.relpath(root, base_path)
parent = relpath.replace(os.sep, '.').lstrip('.')
if relpath != '.' and parent not in found:
# foo.bar package but no foo package, skip
continue
for dir in dirs:
if os.path.isfile(os.path.join(root, dir, '__init__.py')):
package = '.'.join((parent, dir)) if parent else dir
found.append(package)
return found


# Load version from xarm/version.py
main_ns = {}
ver_path = convert_path('xarm/version.py')
with open(os.path.join(os.getcwd(), ver_path)) as ver_file:
exec(ver_file.read(), main_ns)

with open(os.path.join(os.getcwd(), 'xarm/version.py')) as f:
exec(f.read(), main_ns)
version = main_ns['__version__']

long_description = open('README.rst').read()
# long_description = 'long description for xArm-Python-SDK'

try:
with open(os.path.join(os.getcwd(), 'requirements.txt')) as f:
requirements = f.read().splitlines()
except:
requirements = []
# Read README.rst and requirements.txt
with open('README.rst', encoding='utf-8') as f:
long_description = f.read()
with open(os.path.join(os.getcwd(), 'requirements.txt'), encoding='utf-8') as f:
requirements = f.read().splitlines()

setup(
name='xArm-Python-SDK',
name="xarm-python-sdk",
version=version,
author='Vinman',
description='Python SDK for xArm',
packages=find_packages(),
author_email='[email protected]',
packages=['xarm'],
install_requires=requirements,
author="Vinman <[email protected]>",
description="Python SDK for xArm Robotics",
long_description=long_description,
license='MIT',
zip_safe=False
python_requires=">=3.0",
)
2 changes: 1 addition & 1 deletion xarm/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.15.0'
__version__ = "1.15.1"