Skip to content
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

Make this installable with pip #15

Merged
merged 2 commits into from
Jul 31, 2021
Merged
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Author: Christoph Schranz, 12.01.2016

`python Tweaker.py -i demo_object.stl -vb`

If you want to install is as a CLI app first install
[pipx](https://pypa.github.io/pipx/) and then run

pipx install git+https://github.com/ChristophSchranz/Tweaker-3.git
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @traverseda ,

Are you sure the command is really with pipx?

pipx returned "Package cannot be a url", but running with pip worked as expected.

Ubuntu 20.04 here.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear for me why there is a need for pipx. I'll check in a commit that uses pip only to simplify the setup. Feel free to update if there is a reason for pipx.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to work for me. There's no need to use pipx, but it help keep things properly isolated. If you install a bunch of python commands with normal pip you're going to get weird conflicts the dependencies eventually. Pipx works fine for me, I'm using version 0.16.3.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, but I imagine the people who have a need for pipx already use pipx


### Extended mode:

Expand Down
6 changes: 5 additions & 1 deletion Tweaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def getargs():
return arguments


if __name__ == "__main__":
def cli():
global FileHandler
# Get the command line arguments. Run in IDE for demo tweaking.
stime = time()
try:
Expand Down Expand Up @@ -182,3 +183,6 @@ def getargs():
if args.verbose:
print("Tweaking took: \t{:2f} s".format(time() - stime))
print("Successfully Rotated!")

if __name__ == "__main__":
cli()
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"setuptools_scm[toml]>=6.0",
]
build-backend = "setuptools.build_meta"
29 changes: 29 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[metadata]
name = tweaker3
author = Christoph Schranz, Salzburg Research
description = A performant auto-rotate module for objects in 3D Printing
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/ChristophSchranz/Tweaker-3
classifiers =
Programming Language :: Python :: 3
Operating System :: OS Independent

[tool.setuptools_scm]

[options.entry_points]
console_scripts =
tweaker3 = tweaker3.Tweaker:cli

[options]
packages =
tweaker3
package_dir =
tweaker3 = ./
python_requires = >=3.6
install_requires =
numpy

[options.package_data]
* = all.stl