Skip to content

Commit b0359f2

Browse files
committed
New setup tools
1 parent 2f2c896 commit b0359f2

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

.github/dev_requirements.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/pythonpackage.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ name: build
66
on:
77
push:
88
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
119

1210
jobs:
1311
unittest:
@@ -26,16 +24,9 @@ jobs:
2624
- name: Install dependencies
2725
run: |
2826
python -m pip install --upgrade pip
29-
pip install -r .github/dev_requirements.txt
30-
# - name: Lint with flake8
31-
# run: |
32-
# # stop the build if there are Python syntax errors or undefined names
33-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35-
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3627
- name: Test with pytest
3728
run: |
38-
pip install .
29+
pip install .[dev]
3930
pytest
4031
codecov:
4132
# If all tests pass:
@@ -51,10 +42,9 @@ jobs:
5142
- name: Install dependencies
5243
run: |
5344
python -m pip install --upgrade pip
54-
pip install -r .github/dev_requirements.txt
5545
- name: Run coverage
5646
run: |
57-
pip install -e .
47+
pip install -e .[dev]
5848
pytest --cov=roboticstoolbox --cov-report xml:coverage.xml
5949
coverage report
6050
- name: upload coverage to Codecov
@@ -75,8 +65,7 @@ jobs:
7565
- name: Install dependencies
7666
run: |
7767
python -m pip install --upgrade pip
78-
pip install -r .github/dev_requirements.txt
79-
pip install .
68+
pip install .[docs]
8069
- name: Build docs
8170
run: |
8271
cd docs

setup.py

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@
44

55
here = path.abspath(path.dirname(__file__))
66

7+
req = [
8+
'numpy',
9+
'spatialmath-python>=0.7.1',
10+
'scipy',
11+
'matplotlib'
12+
]
13+
14+
dev_req = [
15+
'pytest',
16+
'pytest-cov',
17+
'flake8',
18+
'pyyaml',
19+
]
20+
21+
docs_req = [
22+
'sphinx',
23+
'sphinx_rtd_theme',
24+
'sphinx_markdown_tables'
25+
]
26+
727
# Get the long description from the README file
828
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
929
long_description = f.read()
@@ -15,7 +35,7 @@
1535

1636
def package_files(directory):
1737
paths = []
18-
for (pathhere, directories, filenames) in os.walk(directory):
38+
for (pathhere, _, filenames) in os.walk(directory):
1939
for filename in filenames:
2040
paths.append(os.path.join('..', pathhere, filename))
2141
return paths
@@ -59,9 +79,10 @@ def package_files(directory):
5979

6080
include_package_data=True,
6181

62-
install_requires=[
63-
'numpy',
64-
'spatialmath-python>=0.7.1',
65-
'scipy',
66-
'matplotlib']
82+
install_requires=req,
83+
84+
extras_require={
85+
'dev': dev_req,
86+
'docs': docs_req,
87+
}
6788
)

0 commit comments

Comments
 (0)