From 12cb0a0066cba72d557bb2e38770f270f1ed18c0 Mon Sep 17 00:00:00 2001 From: Borodin Gregory Date: Sun, 8 Jan 2023 22:27:45 +0300 Subject: [PATCH 1/5] Add constraints.txt file --- Makefile | 18 +++++++++++++++--- constraints.txt | 14 ++++++++++++++ requirements.txt | 6 ++---- setup.py | 33 ++++++++++++++++++++------------- 4 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 constraints.txt diff --git a/Makefile b/Makefile index e25ebf0..300c3fb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,17 @@ -init: - pip install -r requirements.txt +SYSTEM_PYTHON := $(shell which python2) +VENV := venv +PYTHON := $(VENV)/bin/python +PIP := $(VENV)/bin/python -m pip +venv: + $(SYSTEM_PYTHON) -m virtualenv venv + $(PIP) install --upgrade pip wheel + +.PHONY: install +install: venv + $(PIP) install -r requirements.txt -c constraints.txt + $(PIP) install -e .[test] + +.PHONY: test test: - nosetests tests \ No newline at end of file + nosetests tests diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 0000000..abde972 --- /dev/null +++ b/constraints.txt @@ -0,0 +1,14 @@ +asn1crypto==1.4.0 +bcrypt==3.1.7 +cffi==1.14.0 +cryptography==2.3.1 +enum34==1.1.10 +idna==2.5 +ipaddress==1.0.23 +paramiko==2.4.0 +pyasn1==0.4.8 +pycparser==2.21 +PyNaCl==1.3.0 +sftpserver==0.3 +six==1.16.0 +ssh2-python==0.8.0 diff --git a/requirements.txt b/requirements.txt index dfe9ee3..19458ad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,3 @@ -nose -sphinx -paramiko==2.4.0 +paramiko sftpserver -ssh2-python==0.8.0 \ No newline at end of file +ssh2-python diff --git a/setup.py b/setup.py index f327397..e5ba195 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,23 @@ #!/usr/bin/env python from setuptools import setup, find_packages -setup(name='sftpclient', - version='1.0.1', - description='Wrapper for some SFTP clients', - author='erachitskiy', - author_email='erachitskiy@pulsepoint.com', - url='https://github.com/pulsepointinc/sftpclient', - packages=find_packages(), - install_requires = [ - 'ssh2-python>=0.8.0', - 'paramiko>=2.3.1' - ], - zip_safe=False - ) \ No newline at end of file +setup( + name='pp-sftpclient', + version='1.0.2', + description='Wrapper for some SFTP clients', + author='erachitskiy', + author_email='erachitskiy@pulsepoint.com', + url='https://github.com/pulsepointinc/sftpclient', + packages=find_packages(), + install_requires=[ + 'paramiko', + 'sftpserver', + 'ssh2-python', + ], + extras_require={ + 'test': [ + 'nose', + ] + }, + zip_safe=False, +) From 591beb6f41e4e208ed2d0bda4039cd2b5d5c21af Mon Sep 17 00:00:00 2001 From: Borodin Gregory Date: Sun, 8 Jan 2023 22:31:20 +0300 Subject: [PATCH 2/5] Update .gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c3bcd27..b9a2013 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ deleteme*.* .noseids 27 *.egg-info -**/*.pyc \ No newline at end of file +**/*.pyc +build/ +dist/ From 4353de9def696238d49bfbf6585b02510c3ad6de Mon Sep 17 00:00:00 2001 From: Borodin Gregory Date: Sun, 8 Jan 2023 22:34:39 +0300 Subject: [PATCH 3/5] Setup github actions --- .github/workflows/makefile.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/makefile.yml diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml new file mode 100644 index 0000000..3e21c5b --- /dev/null +++ b/.github/workflows/makefile.yml @@ -0,0 +1,21 @@ +name: dp-services + +on: [push] + +jobs: + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '2.7' + cache: 'pip' + cache-dependency-path: | + **/setup.py + **/requirements.txt + **/constraints.txt + - name: pip-install + run: make install + - name: unit-tests + run: make test From 29865cd45f2b8b57579d6ee17ee4bfbf4f4d5d91 Mon Sep 17 00:00:00 2001 From: Borodin Gregory Date: Sun, 8 Jan 2023 22:39:40 +0300 Subject: [PATCH 4/5] Simplify Makefile --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 300c3fb..b530f88 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,17 @@ SYSTEM_PYTHON := $(shell which python2) VENV := venv -PYTHON := $(VENV)/bin/python -PIP := $(VENV)/bin/python -m pip +PIP := pip +NOSETESTS := nosetests venv: - $(SYSTEM_PYTHON) -m virtualenv venv + $(SYSTEM_PYTHON) -m virtualenv $(VENV) $(PIP) install --upgrade pip wheel .PHONY: install -install: venv +install: $(PIP) install -r requirements.txt -c constraints.txt $(PIP) install -e .[test] .PHONY: test test: - nosetests tests + $(NOSETESTS) tests From 8ec7afe4e0b78890572e37350bb8753b41ae67be Mon Sep 17 00:00:00 2001 From: Borodin Gregory Date: Sun, 8 Jan 2023 23:53:36 +0300 Subject: [PATCH 5/5] Use pytest instead of nose --- Makefile | 9 +++++++-- setup.py | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b530f88..b2b1c0a 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ SYSTEM_PYTHON := $(shell which python2) VENV := venv PIP := pip -NOSETESTS := nosetests venv: $(SYSTEM_PYTHON) -m virtualenv $(VENV) @@ -14,4 +13,10 @@ install: .PHONY: test test: - $(NOSETESTS) tests + pytest tests + +.PHONY: constraints.txt +constraints.txt: + $(PIP) freeze \ + --exclude-editable \ + --exclude sftpclient > constraints.txt diff --git a/setup.py b/setup.py index e5ba195..0e50e9b 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,8 @@ ], extras_require={ 'test': [ - 'nose', + 'pytest', + 'six', ] }, zip_safe=False,