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
#wget https://github.com/alex-ber/PythonPackageSyncTool/archive/master.zip -O master.zip; unzip master.zip; rm master.zip
pip3 install https://github.com/alex-ber/PythonPackageSyncTool/archive/master.zip#egg=python-package-sync-tool[tests]
python3 -m pip install https://github.com/alex-ber/PythonPackageSyncTool/archive/master.zip
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 these file for yourself, named 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.
After you’ll go to the directory with driver script (whether provided or that you’ve just written). Type
Note: I’m assuming hear that you have config.yml as in data/config.yml.
chmod 755 driver.py
./driver.py –add=some_new_package:1.0.0
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 relative to the folder whether you put driver.py script or absolute.
./driver.py –add=some_new_package
This will run quick check whether package is not in remove list.
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
TODO
Add test
# –add=zzzzzzzzzzzzzzzzzz, # –add=awscli # –add=awscli, # –add=not_exists # –add=not_exists, # –remove=zzzzzzzzzzzzzzzzzz, # –remove=awscli # –remove=awscli, # –remove=not_exists # –remove=not_exists,
Fix add zzz
Test mutual exclusion
Test & fix use of buffer
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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7545665fc8ce2ee00116949128603f4434c2ea33ba32c189640aecfb461912 |
|
MD5 | 75e855e5150f00060d3efe0655eab637 |
|
BLAKE2b-256 | 8527cab6cf3778fd48e7f3e3294420361d84390e4a22fc0345eba66bdee6d533 |
Hashes for python_package_sync_tool-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6774c34779138e35898baf60ccfbf064fa78d59cfa1f49f24c190199d29e0e99 |
|
MD5 | 4da3f0b9c4b2b36ad6c5344799ec42fb |
|
BLAKE2b-256 | 44d334631eac9c4e57b1ed3a6ff0e5803535146d4085fe3f1c0a3d105bf4f4bd |