{ "info": { "author": "Fernando Stecconi", "author_email": "nandilugio@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2" ], "description": "# PePython\n\nNeed help organizing your project's tasks? Just call PePython!\n\n## Install\n\n```bash\npip install pepython\n```\n\n## Quick start\n\nDefine your tasks in a `tasks.py` file your root directory. Note how dependencies are just method calls in the body of the tasks themselves. This allow params passing/forwarding and a more flexible schema than just pre/post dependencies.\n\n```python\nfrom pepython.task_def import task, s\n\n@task\ndef clean(*args):\n s(\"rm -rf build dist *.egg-info\")\n\n@task\ndef build(*args):\n clean()\n s(\"pipenv run python setup.py sdist bdist_wheel\")\n\n@task\ndef publish(*args):\n s(\"pipenv run twine upload dist/*\", interactive=True)\n\n@task\ndef build_and_publish(*args):\n build()\n publish()\n```\n\nThen just call for PePython!\n\n```\n$ pepython --help\nUsage:\n pepython [--defs-path path-to-your-tasks-definitions.py] task [task params ...]\n\n$ pepython clean\nExecuted task 'clean' successfuly.\n\n$ pepython build_and_publish\nEnter your username: your-name-here\nEnter your password: ************\nUploading distributions to https://test.pypi.org/legacy/\nUploading pepython-0.1.0-py2-none-any.whl\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 7.77k/7.77k [00:00<00:00, 42.6kB/s]\nUploading pepython-0.1.0.tar.gz\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 5.65k/5.65k [00:01<00:00, 4.74kB/s]\n\nExecuted task 'build_and_publish' successfuly.\n```\n\nIf you need task **arguments**, they are defined naturally:\n\n```python\n@task\ndef task_args(first_arg, second_arg, *rest_of_args):\n print(\n \"You've passed {} and {} as the 2 first parms, then passed:\\n{}.\"\n .format(first_arg, second_arg, rest_of_args)\n )\n```\n\n```\n$ pepython task_args a b c d e\nYou've passed a and b as the 2 first parms, then passed:\n('c', 'd', 'e').\n\nExecuted task 'task_args' successfuly.\n```\n\nThe main idea is to use Python for your task automation, with all of it's flexibility but without loosing the shell. This is why there is `s()` (short for _shell_).\n\nApart from the `interactive` param shown above (see the password prompt in the output), it has some other possibilities:\n\n**Interactive processes** are easily left piped to the user:\n\n```python\n@task\ndef change_pass():\n s(\"passwd\", interactive=True)\n```\n\n```\n$ pepython change_pass\nChanging password for nando.\n(current) UNIX password:\nEnter new UNIX password:\nRetype new UNIX password:\npasswd: password updated successfully\n\nExecuted task 'change_pass' successfuly.\n```\n\nWhile other **non interactive processes** can be left to be managed by the task:\n\n```python\n@task\ndef process_python_files():\n ls_result = s(\"ls *py\", fail_fast=False, verbose=True)\n\n if not ls_result.ok:\n exit(\"No python files here\")\n\n python_files_raw = ls_result.value['out'].split(\"\\n\")\n python_files = [f.strip() for f in python_files_raw if f.strip()]\n\n print(\n \"These are the python files in this directory:\\n{}\"\n .format(python_files)\n )\n```\n\n```\n$ pepython process_python_files\nExecuted shell command 'ls *py'\nexit code was: 0\nstdout was:\nsetup.py\ntasks.py\n\nstderr was:\n\nThese are the python files in this directory:\n[u'setup.py', u'tasks.py']\n\nExecuted task 'shell_returned_values' successfuly.\n```\n\n## Development\n\nMake sure you have the lastest `pip` and `pipenv` versions:\n\n```bash\npip install --update pip pipenv\n```\n\nTo start developing, start the environment by:\n\n```bash\npipenv shell\npipenv install -d\n```\n\nThis tool uses both [`pipenv`](https://pipenv.readthedocs.io/) for development and [`setuptools`](https://setuptools.readthedocs.io/) for packaging and distribution. To this date there is not a 100% community-accepted best practice so I've taken [this approach](https://github.com/pypa/pipenv/issues/209#issuecomment-337409290). In summary:\n\nTo add an _application_ dependency, add it in `setup.py` and leave it with a loose version definition. Then, just do `pipenv install -e .` to install the dependency. Pipenv locking mecanism will work as expected, since pepython itself in in the `[packages]` section of `Pipfile` (check `Pipfile.lock` and you'll find the deps there).\n\nTo add a _development_ dependency, add it to `Pipfile` via `pipenv install -d `.\n\nThis way there's a single source of truth for package definition. No need to repeat the deps in `setup.py` and `Pipfile*`.\n\n## License\n\nThis project is licensed under the MIT License - see the [`LICENSE`](https://github.com/nandilugio/pepython/blob/master/LICENSE) file for details.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nandilugio/pepython", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pepython", "package_url": "https://pypi.org/project/pepython/", "platform": "", "project_url": "https://pypi.org/project/pepython/", "project_urls": { "Homepage": "https://github.com/nandilugio/pepython" }, "release_url": "https://pypi.org/project/pepython/0.2.3/", "requires_dist": [ "pyyaml", "subprocess32" ], "requires_python": "", "summary": "Simple task automation for projects.", "version": "0.2.3" }, "last_serial": 4998449, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "ccdf5aa8640728c434f85f53f7d5745c", "sha256": "4757a8088b5a5ed23b841820835fcd7afb6cf92475e3d31d0c9362916b95a771" }, "downloads": -1, "filename": "pepython-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ccdf5aa8640728c434f85f53f7d5745c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6643, "upload_time": "2018-10-30T14:50:21", "url": "https://files.pythonhosted.org/packages/17/f0/adaf04935dd10d563f07366e3cf2c407ebd0020b352a48ea03d7fd85efd0/pepython-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e21d827410e1dbce6797bee001f3321b", "sha256": "0e03041ec42cc2dbcf90da84a5857b85132a59097e02dc2210756b3c1ebc3b20" }, "downloads": -1, "filename": "pepython-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e21d827410e1dbce6797bee001f3321b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5146, "upload_time": "2018-10-30T14:50:22", "url": "https://files.pythonhosted.org/packages/c7/30/f6bc04c03906e0506c8be5e8c246dbcf44d7a6e8764803daa70601c7af3b/pepython-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "176f9c099ef5f2136f8bb18e8837752c", "sha256": "0c8f62d44ecc10199127cac9c32f9e2039f57980c4680a9bb86cbef3bf46fbff" }, "downloads": -1, "filename": "pepython-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "176f9c099ef5f2136f8bb18e8837752c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6666, "upload_time": "2019-03-28T14:50:54", "url": "https://files.pythonhosted.org/packages/8e/16/3151132113122b7d694004ead247f07e17351a094dd7cc5773882ebe9590/pepython-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5618869dfec6e87f17e75eabf2bd9722", "sha256": "07dcf288750ed5d99179b321d84c754c9f1f9be7ba7ed8b7c4973f53bd4d8f9d" }, "downloads": -1, "filename": "pepython-0.2.1.tar.gz", "has_sig": false, "md5_digest": "5618869dfec6e87f17e75eabf2bd9722", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5191, "upload_time": "2019-03-28T14:50:55", "url": "https://files.pythonhosted.org/packages/5a/ee/59459825a5a891562afb13b720e4f989e3b39d66c6a2f11bc9bb79d25f5a/pepython-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "0006ade20cdb296582761560edf86fee", "sha256": "6fd429e7a324fa07bf698020ad08e1528314e29cae0a05f09aa3dc9bdf3220b7" }, "downloads": -1, "filename": "pepython-0.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "0006ade20cdb296582761560edf86fee", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6563, "upload_time": "2019-03-28T14:55:51", "url": "https://files.pythonhosted.org/packages/7e/85/5eac7cfa8f661579e8fecd83edeafb13d87092fc31ec8c1528473c2621bd/pepython-0.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6a7f17959cf390e561182bde61ea731", "sha256": "53cd06ca556d0288663b47acc93cf74c729a01cd878ffd42258559c8ea74139d" }, "downloads": -1, "filename": "pepython-0.2.2.tar.gz", "has_sig": false, "md5_digest": "b6a7f17959cf390e561182bde61ea731", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5086, "upload_time": "2019-03-28T14:55:56", "url": "https://files.pythonhosted.org/packages/60/a2/432b81e37dcac8653f019e191bb59df15252d949559ce274e5b2f2438a79/pepython-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "2c1945b74154ab040b09f7c5966ac027", "sha256": "41bd8484c814a3308aec49a60a46610967bd4220d9113b8f746e02ab988a773c" }, "downloads": -1, "filename": "pepython-0.2.3-py2-none-any.whl", "has_sig": false, "md5_digest": "2c1945b74154ab040b09f7c5966ac027", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6591, "upload_time": "2019-03-28T16:02:05", "url": "https://files.pythonhosted.org/packages/f7/73/e4a1a38be3dd52d1d51c83add99d1a77b6ee58efff7e70bae389d85c9f4c/pepython-0.2.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a1fd7140b04000258a052a4e5fc334a", "sha256": "ec30262114e06ffa77678832488e0468a17d21dad806fc7762f5613e343d5d8a" }, "downloads": -1, "filename": "pepython-0.2.3.tar.gz", "has_sig": false, "md5_digest": "1a1fd7140b04000258a052a4e5fc334a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5111, "upload_time": "2019-03-28T16:02:06", "url": "https://files.pythonhosted.org/packages/0f/07/3ea825ade6bd9aefc182c2e6ab7090c4e4ab7b1961576c020ec3f5cc54cf/pepython-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2c1945b74154ab040b09f7c5966ac027", "sha256": "41bd8484c814a3308aec49a60a46610967bd4220d9113b8f746e02ab988a773c" }, "downloads": -1, "filename": "pepython-0.2.3-py2-none-any.whl", "has_sig": false, "md5_digest": "2c1945b74154ab040b09f7c5966ac027", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6591, "upload_time": "2019-03-28T16:02:05", "url": "https://files.pythonhosted.org/packages/f7/73/e4a1a38be3dd52d1d51c83add99d1a77b6ee58efff7e70bae389d85c9f4c/pepython-0.2.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a1fd7140b04000258a052a4e5fc334a", "sha256": "ec30262114e06ffa77678832488e0468a17d21dad806fc7762f5613e343d5d8a" }, "downloads": -1, "filename": "pepython-0.2.3.tar.gz", "has_sig": false, "md5_digest": "1a1fd7140b04000258a052a4e5fc334a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5111, "upload_time": "2019-03-28T16:02:06", "url": "https://files.pythonhosted.org/packages/0f/07/3ea825ade6bd9aefc182c2e6ab7090c4e4ab7b1961576c020ec3f5cc54cf/pepython-0.2.3.tar.gz" } ] }