Skip to content

Commit 1e4d536

Browse files
author
AndyEveritt
committed
setup for pypi
1 parent 92e8c72 commit 1e4d536

9 files changed

Lines changed: 76 additions & 26 deletions

File tree

DuetWebAPI/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
__version__ = "1.0.1"
2+
13
from .dwa_factory import DuetWebAPI

DuetWebAPI/dwa_factory.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
# Python Script containing a class to send commands to, and query specific information from,
2-
# Duet based printers running either Duet RepRap V2 or V3 firmware.
2+
# Duet based printers running Duet RepRap V3 firmware.
33
#
44
# Does NOT hold open the connection. Use for low-volume requests.
55
# Does NOT, at this time, support Duet passwords.
66
#
7-
# Not intended to be a gerneral purpose interface; instead, it contains methods
8-
# to issue commands or return specific information. Feel free to extend with new
9-
# methods for other information; please keep the abstraction for V2 V3
10-
#
11-
# Copyright (C) 2020 Danal Estes all rights reserved.
7+
# Copyright (C) 2020 Andy Everitt all rights reserved.
128
# Released under The MIT License. Full text available via https://opensource.org/licenses/MIT
139
#
1410
# Requires Python3
11+
1512
import logging
1613
from typing import Dict, List
1714

1815
import requests
1916

20-
from DuetWebAPI.api import DSFAPI, DWCAPI, DuetAPI, DuetAPIWrapper
17+
from .api import DSFAPI, DWCAPI, DuetAPI, DuetAPIWrapper
2118

2219

2320
class DuetWebAPIFactory:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Danal
3+
Copyright (c) 2020 Andy
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SHELL := /bin/bash
2+
verbosity=1
3+
4+
update_dist:
5+
python setup.py sdist bdist_wheel
6+
7+
check_dist:
8+
twine check dist/*-$(v)*
9+
10+
upload_test:
11+
twine upload --repository testpypi dist/*-$(v)*

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ Python interface to Duet RepRap V3 firmware via Http REST API.
99
* Duet 2 standalone
1010

1111
# Install
12-
* add `-e "git+https://github.com/AndyEveritt/DuetWebAPI.git@master#egg=duetwebapi"` to `requirements.txt`
13-
* `pip install -r requirements.txt`
12+
```
13+
pip install duetwebapi
14+
```
15+
16+
Alternatively:
17+
```
18+
pip install -e "git+https://github.com/AndyEveritt/DuetWebAPI.git@master#egg=duetwebapi"
19+
```
1420

1521
# Usage
1622
* See 'examples.py' for examples.

examples.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
#!/usr/bin/env python3
2-
from DuetWebAPI import DuetWebAPI as DWA
2+
from duetwebapi import DuetWebAPI as DWA
33
import json
44

55
###################################
66
# Create API link
77
###################################
88
riley = DWA('http://riley')
9-
force_rig = DWA('http://forcerig')
9+
bruce = DWA('http://bruce')
1010

1111
###################################
1212
# REST API methods
1313
###################################
1414
riley.get_model()
15-
force_rig.get_model()
15+
bruce.get_model()
1616

1717
riley.post_code('M115')
18-
force_rig.post_code('M115')
18+
bruce.post_code('M115')
1919

2020
riley.put_file('test.gcode')
21-
force_rig.put_file('test.gcode')
21+
bruce.put_file('test.gcode')
2222

2323
riley.get_file('test.gcode')
24-
force_rig.get_file('test.gcode')
24+
bruce.get_file('test.gcode')
2525

2626
riley.move_file('gcodes/test.gcode', 'gcodes/test2.gcode')
27-
# force_rig.move_file('gcodes/test.gcode', 'gcodes/test2.gcode')
27+
# bruce.move_file('gcodes/test.gcode', 'gcodes/test2.gcode')
2828

2929
riley.delete_file('test2.gcode')
30-
force_rig.delete_file('test2.gcode')
30+
bruce.delete_file('test2.gcode')
3131

3232
riley.get_directory('gcodes')
33-
force_rig.get_directory('gcodes')
33+
bruce.get_directory('gcodes')
3434

3535
###################################
3636
# Wrapper methods
3737
###################################
3838
riley.get_coords()
39-
force_rig.get_coords()
39+
bruce.get_coords()
4040

4141
riley.get_layer()
42-
force_rig.get_layer()
42+
bruce.get_layer()
4343

4444
riley.get_num_extruders()
45-
force_rig.get_num_extruders()
45+
bruce.get_num_extruders()
4646

4747
riley.get_num_tools()
48-
force_rig.get_num_tools()
48+
bruce.get_num_tools()
4949

5050
riley.get_status()
51-
force_rig.get_status()
51+
bruce.get_status()
5252

5353
riley.get_temperatures()
54-
force_rig.get_temperatures()
54+
bruce.get_temperatures()
5555
pass
File renamed without changes.

requirements_dev.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
autopep8==1.5.4
2+
bleach==3.2.1
3+
certifi==2020.6.20
4+
chardet==3.0.4
5+
colorama==0.4.4
6+
docutils==0.16
7+
idna==2.10
8+
keyring==21.4.0
9+
packaging==20.4
10+
pkginfo==1.6.1
11+
pycodestyle==2.6.0
12+
Pygments==2.7.2
13+
pyparsing==2.4.7
14+
pywin32-ctypes==0.2.0
15+
readme-renderer==28.0
16+
requests==2.24.0
17+
requests-toolbelt==0.9.1
18+
rfc3986==1.4.0
19+
six==1.15.0
20+
toml==0.10.1
21+
tqdm==4.51.0
22+
twine==3.2.0
23+
urllib3==1.25.11
24+
webencodings==0.5.1

setup.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
from setuptools import find_packages, setup
2+
import pathlib
3+
4+
# The directory containing this file
5+
HERE = pathlib.Path(__file__).parent
6+
7+
# The text of the README file
8+
README = (HERE / "README.md").read_text()
29

310
setup(
411
name="duetwebapi",
5-
version="0.0.1",
12+
version="1.0.1",
613
include_package_data=True,
714
packages=find_packages(),
815

@@ -13,8 +20,11 @@
1320
author="Andy Everitt",
1421
author_email="andreweveritt@e3d-online.com",
1522
description="Python interface to Duet REST API",
23+
long_description=README,
24+
long_description_content_type="text/markdown",
1625
url="https://github.com/AndyEveritt/DuetWebAPI",
1726
classifiers=[
27+
"License :: OSI Approved :: MIT License",
1828
"Programming Language :: Python :: 3",
1929
"Operating System :: OS Independent",
2030
],

0 commit comments

Comments
 (0)