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
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,32 @@ organized by order of importance.

### Fixed

### Removed

## [0.1.3] - 2026-02-13

### Added

- Added a `dploy clean` subcommand.

### Changed

- Switch to Poetry for packaging instead of setuptools.
- Require at least Python >= 3.10.
- Use black for auto formatting instead of yapf.
- Use custom *DployError* exceptions.
- Version is now sourced from pyproject.toml via importlib.metadata.

### Fixed

- Print syntax help if no valid subcommand was provided.
- Fixed pytest.
- Fixed invoke tasks to work with Poetry and Python 3.13.

### Removed

- Removed requirements.txt in favor of pyproject.toml dependency groups.

## [0.1.2] - 2017-10-26

### Changed
Expand Down Expand Up @@ -45,8 +67,6 @@ organized by order of importance.
Since the symbolic links can't use a relative path fallback to the absolute
version of the path passed in.

### Removed

## [0.1.1] - 2016-12-29

### Fix
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Dploy is a tool for creating symbolic links similarly to [GNU
Stow](https://www.gnu.org/software/stow/). It is provided as a CLI tool and
Python 3.6.2+ module and supports Windows, Linux, and OSX.
Python 3.10+ module and supports Windows, Linux, and OSX.

Dploy's command `stow` creates symbolic links to the contents of source
directories or packages in a specified destination directory. Repeating the
Expand All @@ -22,6 +22,7 @@ that the links to stowed packages have been removed.

* `dploy stow <source-directory>... <destination-directory>`
* `dploy unstow <source-directory>... <destination-directory>`
* `dploy clean <source-directory>... <destination-directory>`
* `dploy --help`

## Rationale
Expand Down
Empty file removed conftest.py
Empty file.
3 changes: 0 additions & 3 deletions dploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
Windows as well as *nix
"""

import sys
from dploy import linkcmd
from dploy import stowcmd

assert sys.version_info >= (3, 3), "Requires Python 3.3 or Greater"


def stow(sources, dest, is_silent=True, is_dry_run=False, ignore_patterns=None):
"""
Expand Down
3 changes: 0 additions & 3 deletions dploy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
The entry point when dploy is called as a module
"""

import sys
from dploy import cli

assert sys.version_info >= (3, 3), "Requires Python 3.3 or Greater"


def main():
"""
Expand Down
8 changes: 3 additions & 5 deletions dploy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def is_same_file(file1, file2):
"""
test if two pathlib.Path() objects are the same file

NOTE: python 3.5 supports pathlib.Path.samefile(file)
TODO: consider using pathlib.Path.samefile() instead
NOTE: this can raise exception FileNotFoundError
"""
return file1.resolve() == file2.resolve()
Expand All @@ -59,8 +59,7 @@ def get_relative_path(path, start_at):
"""
get the relative path of a pathlib.Path() object

NOTE: python 3.4.5 & 3.5.2 support pathlib.Path.path =
str(pathlib.Path)
TODO: consider using Path.relative_to() with walk_up=True (3.12+)
"""
try:
relative_path = os.path.relpath(str(path), str(start_at))
Expand Down Expand Up @@ -112,8 +111,7 @@ def readlink(path, absolute_target=False):
relative.

Note: we can't use pathlib.Path.resolve because it doesn't work for broken
links and raises FileNotFoundError in (Python <3.5) and always returns a
relative path
links (it resolves the target, which may not exist)

"""
link_target = os.readlink(str(path))
Expand Down
26 changes: 3 additions & 23 deletions dploy/version.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
"""
The variable __version__ is a string following the guidelines of semantic
versioning. The general guidelines are as follows
"""Version string sourced from pyproject.toml via importlib.metadata."""

Given a version number MAJOR.MINOR.PATCH, increment the:
from importlib.metadata import version

1. MAJOR version when you make incompatible API changes
2. MINOR version when you add functionality in a backwards-compatible manner
3. PATCH version when you make backwards-compatible bug fixes
4. Additional labels for pre-release and build metadata are available as
extensions to the MAJOR.MINOR.PATCH format.
e.g. 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85
"""

import sys

if sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata

# Single-sourcing the version from pyproject.toml
# https://packaging.python.org/guides/single-sourcing-package-version/

__version__ = metadata.version("dploy")
__version__ = version("dploy")
1,073 changes: 530 additions & 543 deletions poetry.lock

Large diffs are not rendered by default.

53 changes: 23 additions & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
[tool.poetry]
[project]
name = "dploy"
version = "0.1.3-beta"
description = "Provides functionality similar to GNU Stow as a cross platform CLI tool and Python 3 module"
license = "MIT"
authors = ["Ryan Carney <arecarn@gmail.com>"]
authors = [
{ name = "Ryan Carney", email = "arecarn@gmail.com" },
]
readme = "README.md"
homepage = "https://github.com/arecarn/dploy"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Topic :: Utilities"
]
packages = [
{ include = "dploy" },
{ include = "tests" },
]
include = [
".pylintrc",
"CHANGELOG.md",
"conftest.py",
"invoke.yaml",
"requirements.txt",
"tasks.py",
"Topic :: Utilities",
]
version = "0.1.3"
dependencies = []

[tool.poetry.scripts]
dploy = "dploy.__main__:main"
[project.urls]
Homepage = "https://github.com/arecarn/dploy"

[tool.poetry.dependencies]
python = "^3.6.2"
importlib-metadata = { version = ">=1.0.0", python = "<3.8" }
[project.scripts]
dploy = "dploy.__main__:main"

[tool.poetry.dev-dependencies]
pytest = ">=4.6"
pytest-cov = ">=2.6.0"
pylint = "^2.0"
radon = ">=2.0.3"
invoke = "^1.0"
black = "^21.9b0"
[dependency-groups]
dev = [
"pytest>=4.6",
"pytest-cov>=2.6.0",
"pylint>=2.0",
"radon>=2.0.3",
"invoke>=2.0",
"black>=22.0",
"flake8>=5.0",
]

[build-system]
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core>=2.0"]
build-backend = "poetry.core.masonry.api"
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

13 changes: 6 additions & 7 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setup(ctx):
"""
Install python requirements
"""
ctx.run("python -m pip install -r requirements.txt", **RUN_ARGS)
ctx.run("poetry install", **RUN_ARGS)


@task
Expand All @@ -51,7 +51,7 @@ def lint(ctx):
Run pylint on this module
"""
cmds = ["pylint --output-format=parseable", "flake8"]
base_cmd = "python -m {cmd} {files}"
base_cmd = "poetry run {cmd} {files}"

for cmd in cmds:
ctx.run(base_cmd.format(cmd=cmd, files=get_files()), **RUN_ARGS)
Expand All @@ -63,7 +63,7 @@ def reformat_check(ctx):
Run formatting check
"""
cmd = "black --check"
base_cmd = "python -m {cmd} {files}"
base_cmd = "poetry run {cmd} {files}"
ctx.run(base_cmd.format(cmd=cmd, files=get_files()), **RUN_ARGS)


Expand All @@ -73,7 +73,7 @@ def reformat(ctx):
Run formatting
"""
cmd = "black"
base_cmd = "python -m {cmd} {files}"
base_cmd = "poetry run {cmd} {files}"
ctx.run(base_cmd.format(cmd=cmd, files=get_files()), **RUN_ARGS)


Expand All @@ -82,7 +82,7 @@ def metrics(ctx):
"""
Run radon code metrics on this module
"""
cmd = "radon {metric} --min B {files}"
cmd = "poetry run radon {metric} --min B {files}"
metrics_to_run = ["cc", "mi"]
for metric in metrics_to_run:
ctx.run(cmd.format(metric=metric, files=get_files()), **RUN_ARGS)
Expand All @@ -93,8 +93,7 @@ def test(ctx):
"""
Test Task
"""
# Use py.test instead of the recommended pytest so it works on Python 3.3
cmd = "py.test --cov-report term-missing --cov=dploy --color=no"
cmd = "poetry run pytest --cov-report term-missing --cov=dploy --color=no"
ctx.run(cmd, **RUN_ARGS)


Expand Down