Skip to content

Commit

Permalink
Merge branch 'feature/upgrade'
Browse files Browse the repository at this point in the history
  • Loading branch information
llaumgui committed Dec 18, 2023
2 parents d009ac7 + 3aa2ef8 commit c005028
Show file tree
Hide file tree
Showing 11 changed files with 206 additions and 49 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/devops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand Down Expand Up @@ -59,13 +59,13 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: SonarCloud Scan
if: github.event_name != 'pull_request'
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Python ${{ env.pythonLastVersion }}
uses: actions/setup-python@v5
Expand Down
30 changes: 25 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,python
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,python

Expand Down Expand Up @@ -106,7 +105,15 @@ ipython_config.py
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -150,14 +157,29 @@ dmypy.json
cython_debug/

# PyCharm
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/
Expand All @@ -170,6 +192,4 @@ cython_debug/
.history
.ionide

# Support for Project snippet scope

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,python
135 changes: 132 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,134 @@
# SeedboxSync Change History
# ChangeLog

## 0.0.1
## 3.0.2 - Dec 18, 2023

Initial release.
* ⬆️ Update Cement framework.
* 📦 Fix packaging issues.
* 📝 Add Changelog and Contributors files.
* 💚 Fix SonarCloud.
* 👷 Drop Python 3.7 support.
* ⬆️ Now support Python version from 3.8 to 3.11.

## 3.0.1 - Feb 14, 2022

* [Enhancement #36](https://github.com/llaumgui/seedboxsync/issues/36) Update Cement framework.
* [Bug #38](https://github.com/llaumgui/seedboxsync/issues/38) ::set-env is now deprecated.
* [Bug #35](https://github.com/llaumgui/seedboxsync/issues/35) Fix SonarCloud analysis.

## 3.0.0 (Cement / peewee full rebuild) - Sep 23, 2020

*SeedboxSync v1 was the first release on Python 2, SeedboxSync v2 was port from Python 2 code to a compatible Python 3 code and SeedboxSync v3 is a full rewrite on [https://builtoncement.com/](Cement framework) and Peepee ORM.*

Change since v2 serie:

* [Enhancement #27](https://github.com/llaumgui/seedboxsync/issues/27) Rebuild on Cement.
* [Enhancement #29](https://github.com/llaumgui/seedboxsync/issues/29) Add ORM support: Use Peepee ORM.
* [Enhancement #26](https://github.com/llaumgui/seedboxsync/issues/26) New CI/CD platform and features part 2: release with GitHub Actions.
* [Enhancement #30](https://github.com/llaumgui/seedboxsync/issues/30) Better list-in-progress: Add percentage and time prediction.
* [Bugfix #14](https://github.com/llaumgui/seedboxsync/issues/14) No timeout on connections.
* [Enhancement #34](https://github.com/llaumgui/seedboxsync/issues/34) Add ping architecture and Healthchecks support.

## 3.0.0b3 - Sep 15, 2020

Bugfix

## 3.0.0b2 - Sep 4, 2020

Second beta.

* Update documentation.
* Update code.
* [Enhancement #34](https://github.com/llaumgui/seedboxsync/issues/34) Add ping architecture and Healthchecks support.

## 3.0.0b1 - Aug 26, 2020

* [Enhancement #27](https://github.com/llaumgui/seedboxsync/issues/27) Rebuild on Cement.
* [Enhancement #29](https://github.com/llaumgui/seedboxsync/issues/29) Add ORM support: Use Peepee ORM.
* [Enhancement #26](https://github.com/llaumgui/seedboxsync/issues/26) New CI/CD platform and features part 2: release with GitHub Actions.
* [Enhancement #30](https://github.com/llaumgui/seedboxsync/issues/30) Better list-in-progress: Add percentage and time prediction.
* [Bugfix #14](https://github.com/llaumgui/seedboxsync/issues/14) No timeout on connections.

## 2.0.1 - Nov 1, 2018

* [Enhancement #22](https://github.com/llaumgui/seedboxsync/issues/22) Migration from Sphinx to GitHub documentation.
* [Enhancement #23](https://github.com/llaumgui/seedboxsync/issues/23) File size check, don't exist.
* [Enhancement #24](https://github.com/llaumgui/seedboxsync/issues/24) New version system.

## 2.0.0 (Python3) - May 29, 2018

Changes since v1 serie:

* The big change: #12 Python 3 support:
* [Enhancement] Python 3 enhancements.
* [Enhancement] Replace bencode by bcoding because Python 3.
* [Enhancement] Update Paramiko requirement (>=2.2.1).
* Others enhancements:
* [Enhancement] Better usage of configparser.
* [Enhancement #19](https://github.com/llaumgui/seedboxsync/issues/19) Use exception instead exit.
* New features:
* [Enhancement #20](https://github.com/llaumgui/seedboxsync/issues/20) Sync exclusion.
* [Enhancement] New logo.
* QA:
* [Bug] Doc building from Travis. Doc is updated ! See: <https://llaumgui.github.io/seedboxsync/>.
* Use tox for QA and tests.
* Update Travis config.
* Update Code Climate config.

## 2.0.0.beta2 (Last beta ?) - May 15, 2018

* [Enhancement #19](https://github.com/llaumgui/seedboxsync/issues/19) Use exception instead exit.
* [Enhancement #20](https://github.com/llaumgui/seedboxsync/issues/20) Sync Exclusion.
* [Enhancement] New logo.

## 2.0.0.beta1 (Python3 usable !) - Aug 17, 2017

* [Enhancement #15] Replace BencodePy by bcoding to fix --blackhole issue.
* [Bug] Doc building from Travis. Doc is updated ! See: <https://llaumgui.github.io/seedboxsync/>.

## 1.1.2 (The last Python 2 version ?) - Jul 22, 2017

* Some cleanup before archive.
* Backport "prefixed_path" from Python3 branch.

## 2.0.0.alpha1 (First Python3 version !) - Jul 22, 2017

* [Enhancement #12](https://github.com/llaumgui/seedboxsync/issues/12) Python 3 suppport.
* [Enhancement] Python 3 enhancement.
* [Enhancement] Replace bencode by bencodepy because Py3.
* [Enhancement] Update Paramiko requirement (>=2.2.1).
* [Enhancement] Better use of configparser.
* [Enhancement] More Try / except.

## 1.1.1 - Feb 17, 2016

* [Enhancement #13](https://github.com/llaumgui/seedboxsync/issues/13) Better documenttion.
* [Bugfix #13](https://github.com/llaumgui/seedboxsync/issues/13) Typo fix in seedboxsync.ini.

Important: update your seedboxsync.ini and replace wath_path by watch_path.

## 1.1.0 - Feb 4, 2016

* [Enhancement #10](https://github.com/llaumgui/seedboxsync/issues/10): Make code documentation: <https://llaumgui.github.io/seedboxsync>.
* [Enhancement #9](https://github.com/llaumgui/seedboxsync/issues/9): Check if the process inside the PID lock file is still running (thanks @johanndt).
* [Enhancement #3](https://github.com/llaumgui/seedboxsync/issues3): Use a transport interface: you can now make a PR for FTP support ;-).

## 1.0.0 - Oct 13, 2015

First stable version.

## 0.9.0 (a.k.a v1.0.0 RC1) - Aug 20, 2015

First version avalaible from Pypi.

* [enhancement #1](https://github.com/llaumgui/seedboxsync/issues/1): Install seedboxsync with a setup.py.
* [enhancement #2](https://github.com/llaumgui/seedboxsync/issues/2): Check size after download.
* [enhancement #4](https://github.com/llaumgui/seedboxsync/issues/4): Allow shorts arguments.
* [Bug #5](https://github.com/llaumgui/seedboxsync/issues/5): Download fail: cannot concatenate 'str' and 'int' objects.

## 0.5.0 (Full rewrite) - Aug 14, 2015

Pre-release v0.5.0, first release just after a full rewrite.

## 0.1.0 (Pre-release) - Aug 8, 2015

First quick and not so dirty release before an full rewrite.
6 changes: 6 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Contributors

The following people have contributed to Cement, either by way of source code,
documentation, or testing:

- Guillaume Kulakowski (llaumgui) - Creator, Primary Maintainer
14 changes: 3 additions & 11 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# Include docs
include *.md
include LICENSE

recursive-include seedboxsync *.py
recursive-include *.py
include setup.cfg
include *.txt
#recursive-include seedboxsync/templates *

# Include yml example

recursive-include config *
include README.md CHANGELOG.md LICENSE CONTRIBUTORS.md
include *.txt
35 changes: 17 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
.PHONY: clean virtualenv test docker dist dist-upload

clean:
find . -name '*.py[co]' -delete
.PHONY: virtualenv test test-core comply comply-fix dist dist-upload

virtualenv:
virtualenv --prompt '|> seedboxsync <| ' env
virtualenv --prompt '|> cement <| ' env
env/bin/pip install -r requirements-dev.txt
env/bin/python setup.py develop
@echo
@echo "VirtualENV Setup Complete. Now run: source env/bin/activate"
@echo

test:
flake8 seedboxsync --count --show-source --statistics
coverage erase
coverage run --source=seedboxsync -m pytest \
-v \
--cov-report=term \
--cov-report=html:coverage-report \
--junitxml=coverage-report/pytest-report.xml \
tests/
coverage xml -i
test: comply
python -m pytest -v --cov=seedboxsync --cov-report=term --cov-report=html:coverage-report tests/

test-core: comply
python -m pytest -v --cov=seedboxsync.core --cov-report=term --cov-report=html:coverage-report tests/core

docker: clean
docker build -t seedboxsync:latest .
comply:
flake8 seedboxsync/ tests/

comply-fix:
autopep8 -ri cement/ tests/

clean:
find . -name '*.py[co]' -delete
rm -rf doc/build

dist: clean
rm -rf build/* dist/*
rm -rf dist/*
python setup.py sdist
python setup.py bdist_wheel

Expand Down
3 changes: 1 addition & 2 deletions seedboxsync/controllers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import glob
import os
import re
import sre_constants
from paramiko import SSHException
from cement import Controller, ex, fs
from ..core.dao.torrent import Torrent
Expand Down Expand Up @@ -230,7 +229,7 @@ def __exclude_by_pattern(self, filepath: str):

try:
match = re.search(pattern, filepath)
except sre_constants.error:
except re.error:
raise SeedboxSyncConfigurationError('Bad configuration for exclude_syncing ! See the doc at https://docs.python.org/3/library/re.html')

if match is None:
Expand Down
2 changes: 1 addition & 1 deletion seedboxsync/core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from cement.utils.version import get_version as cement_get_version

VERSION = (3, 0, 1, 'final', 0)
VERSION = (3, 0, 2, 'final', 0)


def get_version(version=VERSION):
Expand Down
17 changes: 14 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
setup(
name='seedboxsync',
version=VERSION,
python_requires='>=3.8',
description='Script for sync operations between your NAS and your seedbox',
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
Expand All @@ -28,8 +29,9 @@
license='GPL-2.0',

project_urls={
'Documentation': 'https://llaumgui.github.io/seedboxsync/',
'Bug Reports': 'https://github.com/llaumgui/seedboxsync/issues',
'Source': 'https://github.com/llaumgui/seedboxsync/',
'Source': 'https://github.com/llaumgui/seedboxsync/'
},

classifiers=[
Expand All @@ -40,16 +42,25 @@
'Programming Language :: Python :: 3',
'Environment :: Console',
'Natural Language :: English',
'Operating System :: POSIX',
'Operating System :: POSIX'
],
keywords='seedbox nas sync sftp',

packages=find_packages(exclude=['ez_setup', 'tests*']),
# data_files={'seedboxsync': ['templates/*']},
data_files=[('config', ['config/seedboxsync.yml.example'])],
include_package_data=True,
entry_points="""
[console_scripts]
seedboxsync = seedboxsync.main:main
""",

install_requires=[
'cement==3.0.8',
'pyyaml',
'colorlog',
'paramiko>=2.2.1',
'bcoding>=1.5',
'tabulate',
'peewee'
],
)
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest
from cement import fs


@pytest.fixture(scope="function")
def tmp(request):
"""
Expand Down
Loading

0 comments on commit c005028

Please sign in to comment.