Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
name: Qodana
name: 📇 Code Linting

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- 'releases/*'
branches: [ develop ]
pull_request:
branches: [ develop ]

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number}}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

jobs:
qodana:
linting:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2023.3
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
version-file: "pyproject.toml"
35 changes: 19 additions & 16 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@ on:
types: [created]

jobs:
pypi-publish:
name: Publish to PyPI
run:
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/project/${{ github.repository }}
name: pypi
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies and build
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
python setup.py sdist bdist_wheel
- name: Build and publish
uses: pypa/gh-action-pypi-publish@release/v1
- name: Checkout
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install Python 3.11
run: uv python install 3.11
- name: Build
run: uv build
# Check that basic features work and we didn't miss to include crucial files
- name: Run tests (wheel)
run: uv run --isolated --no-project --with dist/*.whl tests/test_speedcopy.py
- name: Run tests (source distribution)
run: uv run --isolated --no-project --with dist/*.tar.gz tests/test_speedcopy.py
- name: Publish
run: uv publish

7 changes: 0 additions & 7 deletions .hound.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

32 changes: 0 additions & 32 deletions poetry.lock

This file was deleted.

2 changes: 0 additions & 2 deletions poetry.toml

This file was deleted.

63 changes: 45 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,54 @@
[tool.poetry]
[project]
name = "speedcopy"
version = "2.1.5"
description = "Replacement or alternative for python copyfile() utilizing server side copy on network shares for faster copying."
authors = ["Ondrej Samohel <annatar@annatar.net>"]
license = "MIT License"
authors = [
{name = "Ondrej Samohel", email = "annatar@annatar.net"}
]

[tool.poetry.dependencies]
python = ">=2.7"
setuptools = "*"
pysendfile = {version = "^2.0.1", markers = "(sys_platform == 'linux' or sys_platform == 'darwin') and python_version ~= '2.7'"}
license = {file = "LICENSE"}
readme = "README.md"
keywords = ["copy", "files", "filesystem", "network", "smb", "samba", "speed"]
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries",
"Topic :: System :: Filesystems",
"Topic :: Utilities",
]

[tool.poetry.dev-dependencies]
# pytest should be here, but since it is very difficult to
# support py27 with it, we are not defining it here and it
# must be handled manually if needed.
# pytest = "*"
dependencies = [
"typing-extensions"
]

[project.urls]
homepage = "https://github.com/antirotor/speedcopy"
repository = "https://github.com/antirotor/speedcopy"

# this is used only in tests to check if we can deal with extended filesystem attribute
# there is issue with VS 2019 and later with this package so it is commented out.
# is there any other python package to set extended attributes on filesystem?
# pyxattr = "^0.8"

[project.optional-dependencies]
dev = [
"ruff ~= 0.14",
"pytest",
"codespell",
"mypy"

]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["uv_build>=0.9.6,<0.10.0"]
build-backend = "uv_build"


[tool.uv.build-backend]
module-name = "speedcopy"
module-root = ""
98 changes: 98 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"package.py",
]

# Same as Black.
line-length = 79
indent-width = 4


[lint]
preview = true # this is needed for linting empty lines, etc.

pydocstyle.convention = "google"

select = ["ALL"]
ignore = [
"PTH",
"ANN101", # missing-type-function-argument: for older ruff version
"ANN204", # missing-return-type-special-method
"COM812", # missing-trailing-comma
"S603", # subprocess-without-shell-equals-true
"ERA001", # commented-out-code
"TRY003", # raise-vanilla-args
"UP006", # non-pep585-annotation: older python version (type vs. Type)
"UP007", # non-pep604-annotation-union: ..^
"UP035", # deprecated-import: ..
"UP045", # non-pep604-annotation-optional: Use `X | None` for type annotations
"ARG002", # unused-method-argument
"INP001", # implicit-namespace-package: add `__init__.py` to namespaced package
"FIX002", # line-contains-todo: FIX all TODOs
"TD003", # missing-todo-link: missing issue link
"S404", # suspicious-subprocess-import: subprocess module can be insecure
"PLC0415", # import-outside-top-level: import must be on top of the file
"CPY001", # missing-copyright-notice: missing copyright header

]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false

# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"

Loading
Loading