Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
TyberiusPrime committed Jul 15, 2022
2 parents 5874c6f + 0fe54fa commit 5b7c8ba
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 0 deletions.
36 changes: 36 additions & 0 deletions examples/just_python_trust_on_first_use/anysnake2.toml.backup
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


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
venv/*
.DS_Store
dist/*
example_cli_python.egg-info/*
build/*
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.
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-

from .hello import main
main()
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__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loguru
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",
)

0 comments on commit 5b7c8ba

Please sign in to comment.