-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
examples/just_python_trust_on_first_use/anysnake2.toml.backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Here we have github/mercurial python packages | ||
# that get a hash auto-added on first use | ||
# (example used for testing) | ||
# package settings | ||
[anysnake2] | ||
rev = "dev" | ||
|
||
[outside_nixpkgs] | ||
rev = "21.05" # the nixpgks version or github hash | ||
|
||
[nixpkgs] | ||
# the nixpkgs used inside the container | ||
rev = "21.05" # the nixpgks version or github hash | ||
packages = ["which"] | ||
|
||
|
||
[python] # python section is optional | ||
version="3.8" # does not go down to 3.8.x. That's implicit in the nixpkgs (for now) | ||
ecosystem_date="2022-02-16" # you get whatever packages the solver would have produced on that day | ||
|
||
|
||
[python.packages] | ||
# you can use standard python requirements.txt version specification syntax | ||
# i.e. version specifiers from https://www.python.org/dev/peps/pep-0440/#id53 | ||
# you can refer to the repos you cloned | ||
plotnine = { method = "fetchgit", url = "https://github.com/has2k1/plotnine", rev = "6c82cdc20d6f81c96772da73fc07a672a0a0a6ef"} | ||
# and for mercurial | ||
# mercurial example | ||
wormhole = {method = "fetchhg", url="https://hg.sr.ht/~cwt/wormhole", rev="9cabfaa1c96f0d8d362613c99f562796b8a5c1c1"} | ||
# | ||
# and you can fetch from github, git and mercurial (any nix fetcher actually, see | ||
# https://nixos.org/manual/nixpkgs/stable/#chap-pkgs-fetchers) | ||
# if using fetchFromGitHub, the necessary hash will be added to this file | ||
# on a trust-on-first-use-basis | ||
|
||
|
5 changes: 5 additions & 0 deletions
5
examples/just_python_trust_on_first_use/example-cli-python/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
venv/* | ||
.DS_Store | ||
dist/* | ||
example_cli_python.egg-info/* | ||
build/* |
2 changes: 2 additions & 0 deletions
2
examples/just_python_trust_on_first_use/example-cli-python/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This project is in the public domain. Select a license and declare it here when | ||
you adopt python-cmdline-bootstrap to your own project. |
26 changes: 26 additions & 0 deletions
26
examples/just_python_trust_on_first_use/example-cli-python/README.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Example-cli-python | ||
======================== | ||
|
||
example cli in python package. | ||
(forked from jgehrcke/python-cmdline-bootstrap) | ||
|
||
Installation sets up command | ||
************************************** | ||
|
||
Situation before installation:: | ||
|
||
$ hello | ||
bash: hello: command not found | ||
|
||
Installation right from the source tree (or via pip from PyPI):: | ||
|
||
$ python setup.py install | ||
|
||
$ pip install example-cli-python | ||
|
||
Now, the ``hello`` command is available:: | ||
|
||
$ hello ojixzzz | ||
Example version 1.0.0. | ||
Argument strings: ['ojixzzz'] | ||
|
Empty file.
4 changes: 4 additions & 0 deletions
4
examples/just_python_trust_on_first_use/example-cli-python/hello/__main__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from .hello import main | ||
main() |
11 changes: 11 additions & 0 deletions
11
examples/just_python_trust_on_first_use/example-cli-python/hello/hello.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
__version__ = "1.0.0" | ||
|
||
import sys | ||
import loguru | ||
|
||
def main(): | ||
print("Example version %s." % __version__) | ||
print("Argument strings: %s" % sys.argv[1:]) | ||
print("loguru version %s" % loguru.__version__) |
1 change: 1 addition & 0 deletions
1
examples/just_python_trust_on_first_use/example-cli-python/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loguru |
33 changes: 33 additions & 0 deletions
33
examples/just_python_trust_on_first_use/example-cli-python/setup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
"""setup.py: setuptools control.""" | ||
|
||
|
||
import re | ||
from setuptools import setup | ||
|
||
|
||
version = re.search( | ||
'^__version__\s*=\s*"(.*)"', | ||
open('hello/hello.py').read(), | ||
re.M | ||
).group(1) | ||
|
||
|
||
with open("README.rst", "rb") as f: | ||
long_descr = f.read().decode("utf-8") | ||
|
||
setup( | ||
name = "example-cli-python", | ||
packages = ["hello"], | ||
entry_points = { | ||
"console_scripts": ['hello = hello.hello:main'] | ||
}, | ||
version = version, | ||
description = "Python command line example package", | ||
long_description = long_descr, | ||
author = "Oji Setyawan", | ||
author_email = "[email protected]", | ||
url = "https://github.com/ojixzzz/example-cli-python", | ||
) |