Small tool to sync package from different machines
Project description
PythonPackageSyncTool
PythonPackageSyncTool is a Python utility to "fix" requirements.txt.
It is used to make manipulation on requirements.txt that is produces by 'pip freeze'
Getting Help
QuickStart
pip3 install python-package-sync-tool
cd /opt/anaconda3/lib/python3.7/site-packages/alexber/reqsync/data/
Note: This is Path where you're actually install my utility, it can be different in your machine.
If you use venv it will look something like:
cd /opt/MyProject/venv/Lib/site-packages/alexber/reqsync
Alternatively you can create sctipt file for yourself, named, say, driver.py:
#!/usr/bin/python3
import alexber.reqsync.app as app
if __name__ == "__main__":
app.main()
Than create file config.yml near your script (see data/config.yml) or provide all parameter using command line argruments. Use ':' in places where you should naturally write '==' (see explanation below).
Parammeters 'source' and 'destination' are required. You should also provide (requirements) file for 'source'.
'mutual_exclusion' has default value True.
Now, type
python3 -m alexber.reqsync.data --add=some_new_package:1.0.0
or if you're using script (driver.py) go the directory with the script and type
./driver.py --add=some_new_package:1.0.0
This will run quick check whether package is not in remove list. If it is, the utility will fail. You can override this
beahivor by supplying --mutual_exclusion=False
.
Then, this will add some_new_package with version 1.0.0 to the requirements-dest.txt
Note:
Semicolomn and not equal sign is used here due to Python limitaion of usage of equal sign in the value in the command line.
You can specified multiple packages using comma delimiter.
You can specifiy path to your config file using --config_file
.
It can be absolute or relative. If you're running using script (driver.py), that it can be relative to the directory
whether you put your script. If you're running as the module (python3 -m
), it can be relative to
/opt/anaconda3/lib/python3.7/site-packages/alexber/reqsync/data/
(exact path can be different, see above).
You can supplied multiply packages by using comma:
python3 -m alexber.reqsync.data --add=some_new_package:1.0.0,another_new_package:2.0.0
or if you're using script (driver.py) go the directory with the script and type
./driver.py --add=some_new_package:1.0.0,another_new_package:2.0.0
Installing from source
python3 -m pip install . # only installs "required"
python3 -m pip install .[test] # installs dependencies for tests
From the directory with setup.py
python3 setup.py test #run all tests
pytest
Requirements
PythonPackageSyncTool requires the following modules.
-
Python 3.7+
-
PyYAML==5.1
Changelog
All notable changes to this project will be documented in this file.
#https://pypi.org/manage/project/python-package-sync-tool/releases/
[Unrelased]
Add test
- --add=zzzzzzzzzzzzzzzzzz,
- --add=awscli
- --add=awscli,
- --add=not_exists
- --add=not_exists,
- --add=aaaaaaaaaaaaaaaaaaa
- Change assert to more thoroguh
- --remove=zzzzzzzzzzzzzzzzzz,
- --remove=awscli
- --remove=awscli,
- --remove=not_exists
- --remove=not_exists,
-
Test mutual exclusion
-
Test & fix use of buffer
[0.1.7] - 2019-05-20
Removed
- Some project cleanup.
Changed
- CHANGELOG and REAMDE now use Markdown format.
- REAMDE totally rewritten.
- Fixing bugs in the core algorithm. Simplifying code.
- Fixing correct handling of package adding to the buttom of the list.
[0.1.6] - 2019-05-20
Added
__init__.py
file added to alexber.reqsync.data.
[0.1.5] - 2019-05-20
Added
- Small tool to sync package from different machines.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for python_package_sync_tool-0.1.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd2239047c73a6883b00c5c1310115b3794af0243933da55a4bd9dc1e856514 |
|
MD5 | 3deb05ba1288a9ebfe8a84370bcb46bc |
|
BLAKE2b-256 | bf9bb160762dc14ad8f8f1308f8d497cb3efc9ae22b95a30a2fe490882e3019a |
Hashes for python_package_sync_tool-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64f31a7d3bf825b2f315792bbaaf481c31ffefdc034a73b945f61c75a51a880b |
|
MD5 | c59bf1cc4d54b03da0bcf92f8dab86b0 |
|
BLAKE2b-256 | dc567966b08d8eea85f4e2563891dda30b838b35b302ba8042382c3a21994b72 |