`files.put()` does not expand `~`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- devops, infrastructure
Research direction
Start at the pyinfra.operations.files entry point and reproduce the issue with the provided files.put example and pyinfra @local test.py command. Trace how the destination is handled and add coverage for a ~/ destination; done means the file is copied under the home directory rather than creating a literal ~ directory.
Written by the indexing model from the issue text.
Description
Describe the bug
files.put() does not expand ~ to the value of $HOME
To Reproduce
from pyinfra.operations import files
files.put(name='Copy file', src='README.md', dest='~/pyinfra-README.md')
pyinfra @local test.py
Observed behavior
A directory named ~ is created inside the current working directory.
Expected behavior
The file is copied to ~/pyinfra-README.md.
Meta
System Information
System: Linux
Platform: Linux-6.1.0-26-amd64-x86_64-with-glibc2.36
Release: 6.1.0-26-amd64
Machine: x86_64
pyinfra: v3.1.1
black: v24.4.2
black: v24.4.2
click: v8.1.7
configparser: v7.1.0
coverage: v7.5.1
coverage: v7.5.1
distro: v1.9.0
flake8: v7.0.0
flake8: v7.0.0
flake8-black: v0.3.6
flake8-black: v0.3.6
flake8-isort: v6.1.1
flake8-isort: v6.1.1
flake8-spellcheck: v0.12.1
gevent: v24.10.3
importlib-metadata: v8.5.0
ipdb: v0.13.13
ipdbplugin: v1.5.0
ipython: v8.29.0
isort: v5.13.2
isort: v5.13.2
jinja2: v3.1.4
mypy: v1.13.0
mypy: v1.13.0
myst-parser: v2.0.0
myst-parser: v2.0.0
packaging: v24.1
paramiko: v3.5.0
pyinfra-guzzle-sphinx-theme: v0.16
pyinfra-guzzle-sphinx-theme: v0.16
pytest: v8.2.1
pytest: v8.2.1
pytest-cov: v5.0.0
pytest-cov: v5.0.0
python-dateutil: v2.9.0.post0
pywinrm: v0.5.0
redbaron: v0.9.2
setuptools: v66.1.1
sphinx: v6.2.1
sphinx: v6.2.1
twine: v5.1.1
typeguard: v4.4.0
types-PyYAML: v6.0.12.20240917
types-PyYAML: v6.0.12.20240917
types-cryptography: v3.3.23.2
types-cryptography: v3.3.23.2
types-paramiko: v3.5.0.20240928
types-paramiko: v3.5.0.20240928
types-python-dateutil: v2.9.0.20241003
types-python-dateutil: v2.9.0.20241003
types-setuptools: v75.2.0.20241025
types-setuptools: v75.2.0.20241025
typing-extensions: v4.12.2
wheel: v0.44.0
Executable: /data/Code/pyinfra/venv/bin/pyinfra
Python: 3.11.2 (CPython, GCC 12.2.0)
- Dominant language
- Python
- Stars
- 6k
- Forks
- 548
- Avg merge
- 7d 17h
- Merged PRs (30d)
- 13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pyinfra-dev/pyinfra
-
new feature
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pyinfra-dev/pyinfra#1967 ·
-
facts new feature operations
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pyinfra-dev/pyinfra#1896 ·
-
bug facts operations
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pyinfra-dev/pyinfra#1869 ·
-
bug operations
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyinfra-dev/pyinfra#1219 · 2 comments · 2 reactions ·
-
operations spec
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pyinfra-dev/pyinfra#1207 · 2 comments ·
All issues in pyinfra-dev/pyinfra
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100