diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-alfred-cli.spec | 212 | ||||
| -rw-r--r-- | sources | 2 | 
3 files changed, 123 insertions, 92 deletions
@@ -1 +1,2 @@  /alfred-cli-1.2.0.tar.gz +/alfred_cli-2.0.0.tar.gz diff --git a/python-alfred-cli.spec b/python-alfred-cli.spec index 62dbf4f..1f89b28 100644 --- a/python-alfred-cli.spec +++ b/python-alfred-cli.spec @@ -1,20 +1,17 @@  %global _empty_manifest_terminate_build 0  Name:		python-alfred-cli -Version:	1.2.0 +Version:	2.0.0  Release:	1 -Summary:	alfred is a building tool to make engineering tasks easier to develop and to maintain +Summary:	alfred is an extensible building tool that can replace a Makefile or Fabric. Writing commands in python is done in minutes.  License:	MIT  URL:		https://github.com/FabienArcellier/alfred-cli#alfred -Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/79/6d/d361a38d352fb883a807abc0eec30329274f94932c86c50aacd022e9c801/alfred-cli-1.2.0.tar.gz +Source0:	https://mirrors.aliyun.com/pypi/web/packages/5d/ae/9c66c0141dafd82146a430a4526def53c70d6a07c7f38ef84bff18b449bc/alfred_cli-2.0.0.tar.gz  BuildArch:	noarch  Requires:	python3-click  Requires:	python3-plumbum -Requires:	python3-PyYAML -Requires:	python3-build -Requires:	python3-pylint -Requires:	python3-coverage -Requires:	python3-twine +Requires:	python3-pyyaml +Requires:	python3-toml  %description  Ran 1 test in 0.000s @@ -35,10 +32,43 @@ def ci(verbose: bool):  ```  the ``alfred.is_posix``, ``alfred.is_linux``, ``alfred.is_macos``, ``alfred.is_windows`` functions allow you to quickly  target the environment on which specific processing must be performed. +### Override environment variables +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +def ci(): +    with alfred.env(SCREEN="display"): +        bash = alfred.sh("bash") +        bash.run("-c" "echo $SCREEN") +``` +#### Add directories into pythonpath +Adding a folder in the pythonpath variable allows you to expose packages without declaring them in the manifest. +This pattern is useful with poetry to be able to reuse the code of the package tests in this one for example. +The ``alfred.pythonpath`` decorator adds the project root. You can save specific folders here. +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +@alfred.pythonpath() +def ci(): +    bash = alfred.sh("bash") +    alfred.run(bash, ["-c" "echo $SCREEN"]) +``` +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +@alfred.pythonpath(['tests'], append_project=False) +def ci(): +    bash = alfred.sh("bash") +    alfred.run(bash, ["-c", "echo $SCREEN"]) +``` +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +def ci(): +    with alfred.pythonpath(): +        bash = alfred.sh("bash") +        alfred.run(bash, ["-c", "echo $SCREEN"]) +```  ## Developper guideline  ```bash -pipenv install -pipenv shell +poetry install +poetry shell  ```  ```  $ alfred @@ -58,28 +88,6 @@ Commands:    tests:acceptances  validate alfred with acceptances testing    tests:units        validate alfred with unit testing  ``` -### Install development environment -Use make to instanciate a python virtual environment in ./venv and install the -python dependencies. -```bash -pipenv install --dev -``` -### Install production environment -```bash -pipenv install -``` -### Initiate or update the library requirements -If you want to initiate or update all the requirements `install_requires` declared in `setup.py` -and freeze a new `Pipfile.lock`, use this command -```bash -pipenv update -``` -### Activate the python environment -When you setup the requirements, a `venv` directory on python 3 is created. -To activate the venv, you have to execute : -```bash -pipenv shell -```  ### Run the linter and the unit tests  Before commit or send a pull request, you have to execute `pylint` to check the syntax  of your code and run the unit tests to validate the behavior. @@ -90,7 +98,7 @@ alfred ci  * Fabien Arcellier  ## License  MIT License -Copyright (c) 2021-2022 Fabien Arcellier +Copyright (c) 2021-2023 Fabien Arcellier  Permission is hereby granted, free of charge, to any person obtaining a copy  of this software and associated documentation files (the "Software"), to deal  in the Software without restriction, including without limitation the rights @@ -108,7 +116,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.  %package -n python3-alfred-cli -Summary:	alfred is a building tool to make engineering tasks easier to develop and to maintain +Summary:	alfred is an extensible building tool that can replace a Makefile or Fabric. Writing commands in python is done in minutes.  Provides:	python-alfred-cli  BuildRequires:	python3-devel  BuildRequires:	python3-setuptools @@ -132,10 +140,43 @@ def ci(verbose: bool):  ```  the ``alfred.is_posix``, ``alfred.is_linux``, ``alfred.is_macos``, ``alfred.is_windows`` functions allow you to quickly  target the environment on which specific processing must be performed. +### Override environment variables +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +def ci(): +    with alfred.env(SCREEN="display"): +        bash = alfred.sh("bash") +        bash.run("-c" "echo $SCREEN") +``` +#### Add directories into pythonpath +Adding a folder in the pythonpath variable allows you to expose packages without declaring them in the manifest. +This pattern is useful with poetry to be able to reuse the code of the package tests in this one for example. +The ``alfred.pythonpath`` decorator adds the project root. You can save specific folders here. +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +@alfred.pythonpath() +def ci(): +    bash = alfred.sh("bash") +    alfred.run(bash, ["-c" "echo $SCREEN"]) +``` +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +@alfred.pythonpath(['tests'], append_project=False) +def ci(): +    bash = alfred.sh("bash") +    alfred.run(bash, ["-c", "echo $SCREEN"]) +``` +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +def ci(): +    with alfred.pythonpath(): +        bash = alfred.sh("bash") +        alfred.run(bash, ["-c", "echo $SCREEN"]) +```  ## Developper guideline  ```bash -pipenv install -pipenv shell +poetry install +poetry shell  ```  ```  $ alfred @@ -155,28 +196,6 @@ Commands:    tests:acceptances  validate alfred with acceptances testing    tests:units        validate alfred with unit testing  ``` -### Install development environment -Use make to instanciate a python virtual environment in ./venv and install the -python dependencies. -```bash -pipenv install --dev -``` -### Install production environment -```bash -pipenv install -``` -### Initiate or update the library requirements -If you want to initiate or update all the requirements `install_requires` declared in `setup.py` -and freeze a new `Pipfile.lock`, use this command -```bash -pipenv update -``` -### Activate the python environment -When you setup the requirements, a `venv` directory on python 3 is created. -To activate the venv, you have to execute : -```bash -pipenv shell -```  ### Run the linter and the unit tests  Before commit or send a pull request, you have to execute `pylint` to check the syntax  of your code and run the unit tests to validate the behavior. @@ -187,7 +206,7 @@ alfred ci  * Fabien Arcellier  ## License  MIT License -Copyright (c) 2021-2022 Fabien Arcellier +Copyright (c) 2021-2023 Fabien Arcellier  Permission is hereby granted, free of charge, to any person obtaining a copy  of this software and associated documentation files (the "Software"), to deal  in the Software without restriction, including without limitation the rights @@ -226,10 +245,43 @@ def ci(verbose: bool):  ```  the ``alfred.is_posix``, ``alfred.is_linux``, ``alfred.is_macos``, ``alfred.is_windows`` functions allow you to quickly  target the environment on which specific processing must be performed. +### Override environment variables +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +def ci(): +    with alfred.env(SCREEN="display"): +        bash = alfred.sh("bash") +        bash.run("-c" "echo $SCREEN") +``` +#### Add directories into pythonpath +Adding a folder in the pythonpath variable allows you to expose packages without declaring them in the manifest. +This pattern is useful with poetry to be able to reuse the code of the package tests in this one for example. +The ``alfred.pythonpath`` decorator adds the project root. You can save specific folders here. +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +@alfred.pythonpath() +def ci(): +    bash = alfred.sh("bash") +    alfred.run(bash, ["-c" "echo $SCREEN"]) +``` +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +@alfred.pythonpath(['tests'], append_project=False) +def ci(): +    bash = alfred.sh("bash") +    alfred.run(bash, ["-c", "echo $SCREEN"]) +``` +```python +@alfred.command('ci', help="execute continuous integration process of alfred") +def ci(): +    with alfred.pythonpath(): +        bash = alfred.sh("bash") +        alfred.run(bash, ["-c", "echo $SCREEN"]) +```  ## Developper guideline  ```bash -pipenv install -pipenv shell +poetry install +poetry shell  ```  ```  $ alfred @@ -249,28 +301,6 @@ Commands:    tests:acceptances  validate alfred with acceptances testing    tests:units        validate alfred with unit testing  ``` -### Install development environment -Use make to instanciate a python virtual environment in ./venv and install the -python dependencies. -```bash -pipenv install --dev -``` -### Install production environment -```bash -pipenv install -``` -### Initiate or update the library requirements -If you want to initiate or update all the requirements `install_requires` declared in `setup.py` -and freeze a new `Pipfile.lock`, use this command -```bash -pipenv update -``` -### Activate the python environment -When you setup the requirements, a `venv` directory on python 3 is created. -To activate the venv, you have to execute : -```bash -pipenv shell -```  ### Run the linter and the unit tests  Before commit or send a pull request, you have to execute `pylint` to check the syntax  of your code and run the unit tests to validate the behavior. @@ -281,7 +311,7 @@ alfred ci  * Fabien Arcellier  ## License  MIT License -Copyright (c) 2021-2022 Fabien Arcellier +Copyright (c) 2021-2023 Fabien Arcellier  Permission is hereby granted, free of charge, to any person obtaining a copy  of this software and associated documentation files (the "Software"), to deal  in the Software without restriction, including without limitation the rights @@ -299,7 +329,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.  %prep -%autosetup -n alfred-cli-1.2.0 +%autosetup -n alfred_cli-2.0.0  %build  %py3_build @@ -313,20 +343,20 @@ if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi  if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi  pushd %{buildroot}  if [ -d usr/lib ]; then -	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +	find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst  fi  if [ -d usr/lib64 ]; then -	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +	find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst  fi  if [ -d usr/bin ]; then -	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +	find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst  fi  if [ -d usr/sbin ]; then -	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +	find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst  fi  touch doclist.lst  if [ -d usr/share/man ]; then -	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +	find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst  fi  popd  mv %{buildroot}/filelist.lst . @@ -339,5 +369,5 @@ mv %{buildroot}/doclist.lst .  %{_docdir}/*  %changelog -* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2.0-1 +* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.0-1  - Package Spec generated @@ -1 +1 @@ -92053ece1e7e66db5d686646d2252fed  alfred-cli-1.2.0.tar.gz +f1050e9829565c776aa1d8866bf2bb32  alfred_cli-2.0.0.tar.gz  | 
