From cd8d9fb95ecb65d29e1d9c43e564bd9c89a05eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Tue, 1 Dec 2020 08:43:12 +0100 Subject: [PATCH 1/3] Fix ResourceWarning: unclosed file in setup.py Also prevent potential identical warning in `plat_other.py`. --- send2trash/plat_other.py | 5 ++--- setup.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/send2trash/plat_other.py b/send2trash/plat_other.py index dd45606..f5dcadd 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -112,9 +112,8 @@ def trash_move(src, dst, topdir=None): check_create(infopath) os.rename(src, op.join(filespath, destname)) - f = open(op.join(infopath, destname + INFO_SUFFIX), "w") - f.write(info_for(src, topdir)) - f.close() + with open(op.join(infopath, destname + INFO_SUFFIX), "w") as f: + f.write(info_for(src, topdir)) def find_mount_point(path): diff --git a/setup.py b/setup.py index 60a07a1..3ac4580 100644 --- a/setup.py +++ b/setup.py @@ -17,9 +17,8 @@ CLASSIFIERS = [ "Topic :: Desktop Environment :: File Managers", ] -LONG_DESCRIPTION = ( - open("README.rst", "rt").read() + "\n\n" + open("CHANGES.rst", "rt").read() -) +with open("README.rst", "rt") as f1, open("CHANGES.rst", "rt") as f2: + LONG_DESCRIPTION = f1.read() + "\n\n" + f2.read() setup( name="Send2Trash", From 38ae2b63d2ccce0a986762c8facabca5425dff14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Tue, 1 Dec 2020 08:36:59 +0100 Subject: [PATCH 2/3] Expand supported Python versions --- .travis.yml | 11 +++++++---- README.rst | 2 +- setup.py | 2 ++ tox.ini | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3bd571..70e1c92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,12 +17,15 @@ matrix: - python: "3.4" - python: "3.5" - python: "3.6" - # Obtain Python 3.7 from xenial as per https://github.com/travis-ci/travis-ci/issues/9815 - python: "3.7" - dist: xenial + - python: "3.8" + - python: "3.9" + - python: "nightly" # 3.10 + before_script: + - export TOXENV=py310 install: - - pip install tox + - python -m pip install tox before_script: - export TOXENV=$(echo py$TRAVIS_PYTHON_VERSION | tr -d .) script: - - tox + - python -m tox diff --git a/README.rst b/README.rst index 09556da..aefbfa1 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ Installation You can download it with pip:: - pip install Send2Trash + python -m pip install -U send2trash or you can download the source from http://github.com/arsenetar/send2trash and install it with:: diff --git a/setup.py b/setup.py index 60a07a1..5504356 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,8 @@ CLASSIFIERS = [ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Desktop Environment :: File Managers", ] diff --git a/tox.ini b/tox.ini index 8fa3a22..702ea2d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,py3-win +envlist = py{27,34,35,36,37,38,39,310,3-win} skip_missing_interpreters = True [testenv] From 00dfe77e4087cd5286a191ca6fb99e9d45af7338 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Tue, 12 Jan 2021 18:21:53 -0600 Subject: [PATCH 3/3] Add console_script entry point, close #50 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4128186..d3203a5 100644 --- a/setup.py +++ b/setup.py @@ -37,4 +37,5 @@ setup( classifiers=CLASSIFIERS, extras_require={"win32": ["pywin32"]}, project_urls={"Bug Reports": "https://github.com/arsenetar/send2trash/issues"}, + entry_points={"console_scripts": ["send2trash=send2trash.__main__:main"]}, )