git-remote-dropbox 2.0.4__tar.gz → 2.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/CONTRIBUTING.md +6 -1
  2. git_remote_dropbox-2.0.5/DEVELOPMENT.md +78 -0
  3. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/PKG-INFO +2 -2
  4. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/README.md +1 -1
  5. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/__init__.py +1 -1
  6. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/helper.py +1 -1
  7. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/tests/test-lib.sh +1 -1
  8. git_remote_dropbox-2.0.4/tests/README.md +0 -22
  9. git_remote_dropbox-2.0.4/tests/Vagrantfile +0 -27
  10. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/.editorconfig +0 -0
  11. /git_remote_dropbox-2.0.4/.github/workflows/build.yml → /git_remote_dropbox-2.0.5/.github/workflows/ci.yml +0 -0
  12. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/.gitignore +0 -0
  13. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/DESIGN.md +0 -0
  14. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/LICENSE.md +0 -0
  15. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/pyproject.toml +0 -0
  16. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/cli/__init__.py +0 -0
  17. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/cli/common.py +0 -0
  18. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/cli/helper.py +0 -0
  19. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/cli/manage.py +0 -0
  20. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/constants.py +0 -0
  21. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/git.py +0 -0
  22. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/src/git_remote_dropbox/util.py +0 -0
  23. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/tests/.gitignore +0 -0
  24. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/tests/dropbox_delete.py +0 -0
  25. {git_remote_dropbox-2.0.4 → git_remote_dropbox-2.0.5}/tests/test.sh +0 -0
@@ -48,7 +48,11 @@ substantial changes to the code base, it is *highly recommended* that you first
48
48
  Any changes to the code base should follow the style and coding conventions
49
49
  used in the rest of the project. The version history should be clean, and
50
50
  commit messages should be descriptive and [properly
51
- formatted][commit-messages].
51
+ formatted][commit-messages]. It's recommended that you add unit tests to
52
+ demonstrate that the bug is fixed (or that the feature works).
53
+
54
+ See the [git-remote-dropbox development guide][development] to learn how to run
55
+ the tests, type checking, and more.
52
56
 
53
57
  ---
54
58
 
@@ -61,3 +65,4 @@ If you have any questions about anything, feel free to [ask][email]!
61
65
  [email]: mailto:me@anishathalye.com
62
66
  [gitremote-helpers]: https://www.kernel.org/pub/software/scm/git/docs/gitremote-helpers.html
63
67
  [commit-messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
68
+ [development]: DEVELOPMENT.md
@@ -0,0 +1,78 @@
1
+ # Development
2
+
3
+ git-remote-dropbox uses the [Hatch] project manager ([installation instructions][hatch-install]).
4
+
5
+ Hatch automatically manages dependencies and runs type checking, formatting/linting, and other operations in isolated [environments][hatch-environments].
6
+
7
+ [Hatch]: https://hatch.pypa.io/
8
+ [hatch-install]: https://hatch.pypa.io/latest/install/
9
+ [hatch-environments]: https://hatch.pypa.io/latest/environment/
10
+
11
+ ## Testing
12
+
13
+ git-remote-dropbox has integration tests written in shell scripts. The tests exercise git-remote-dropbox via git operations, so the tests interact with the filesystem. For this reason, it is recommended that tests are run inside a Docker container (or in CI).
14
+
15
+ To run the tests, first start a Docker container:
16
+
17
+ ```bash
18
+ docker run -it --rm -v "${PWD}:/git-remote-dropbox" -w /git-remote-dropbox python:3.13-bookworm /bin/bash
19
+ ```
20
+
21
+ Now, inside the Docker container, install the git-remote-dropbox package:
22
+
23
+ ```bash
24
+ pip install -e .
25
+ ```
26
+
27
+ Next, set the `DROPBOX_TOKEN` environment variable (to your long-lived access token). This is required because the tests actually interact with the real Dropbox API.
28
+
29
+ ```bash
30
+ export DROPBOX_TOKEN='...'
31
+ ```
32
+
33
+ Finally, run the tests:
34
+
35
+ ```bash
36
+ tests/test.sh
37
+ ```
38
+
39
+ ## Type checking
40
+
41
+ You can run the [mypy static type checker][mypy] with:
42
+
43
+ ```bash
44
+ hatch run types:check
45
+ ```
46
+
47
+ [mypy]: https://mypy-lang.org/
48
+
49
+ ## Formatting and linting
50
+
51
+ You can run the [Ruff][ruff] formatter and linter with:
52
+
53
+ ```bash
54
+ hatch fmt
55
+ ```
56
+
57
+ This will automatically make [safe fixes][fix-safety] to your code. If you want to only check your files without making modifications, run `hatch fmt --check`.
58
+
59
+ [ruff]: https://github.com/astral-sh/ruff
60
+ [fix-safety]: https://docs.astral.sh/ruff/linter/#fix-safety
61
+
62
+ ## Packaging
63
+
64
+ You can use [`hatch build`][hatch-build] to create build artifacts, a [source distribution ("sdist")][sdist] and a [built distribution ("wheel")][bdist].
65
+
66
+ You can use [`hatch publish`][hatch-publish] to publish build artifacts to [PyPI][pypi].
67
+
68
+ [hatch-build]: https://hatch.pypa.io/latest/build/
69
+ [sdist]: https://packaging.python.org/en/latest/glossary/#term-Source-Distribution-or-sdist
70
+ [bdist]: https://packaging.python.org/en/latest/glossary/#term-Built-Distribution
71
+ [hatch-publish]: https://hatch.pypa.io/latest/publish/
72
+ [pypi]: https://pypi.org/
73
+
74
+ ## Continuous integration
75
+
76
+ Testing, type checking, and formatting/linting is [checked in CI][ci].
77
+
78
+ [ci]: .github/workflows/ci.yml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-remote-dropbox
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: A transparent bidirectional bridge between Git and Dropbox
5
5
  Project-URL: homepage, https://github.com/anishathalye/git-remote-dropbox
6
6
  Project-URL: repository, https://github.com/anishathalye/git-remote-dropbox.git
@@ -17,7 +17,7 @@ Requires-Python: >=3.6
17
17
  Requires-Dist: dropbox<13,>=12
18
18
  Description-Content-Type: text/markdown
19
19
 
20
- # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/workflows/CI/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions?query=workflow%3ACI) [![pypi](https://img.shields.io/pypi/v/git-remote-dropbox.svg)](https://pypi.org/pypi/git-remote-dropbox/)
20
+ # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/actions/workflows/ci.yml/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions/workflows/ci.yml) [![pypi](https://img.shields.io/pypi/v/git-remote-dropbox.svg)](https://pypi.org/pypi/git-remote-dropbox/)
21
21
 
22
22
  git-remote-dropbox is a transparent bidirectional bridge between Git and
23
23
  Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote!
@@ -1,4 +1,4 @@
1
- # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/workflows/CI/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions?query=workflow%3ACI) [![pypi](https://img.shields.io/pypi/v/git-remote-dropbox.svg)](https://pypi.org/pypi/git-remote-dropbox/)
1
+ # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/actions/workflows/ci.yml/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions/workflows/ci.yml) [![pypi](https://img.shields.io/pypi/v/git-remote-dropbox.svg)](https://pypi.org/pypi/git-remote-dropbox/)
2
2
 
3
3
  git-remote-dropbox is a transparent bidirectional bridge between Git and
4
4
  Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote!
@@ -18,4 +18,4 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
19
  # SOFTWARE.
20
20
 
21
- __version__ = "2.0.4"
21
+ __version__ = "2.0.5"
@@ -150,7 +150,7 @@ class Helper:
150
150
  self._delete(dst)
151
151
  else:
152
152
  self._push(src, dst)
153
- if self._first_push and (not remote_head or src == git.symbolic_ref("HEAD")):
153
+ if self._first_push and (not remote_head or src == git.symbolic_ref_value("HEAD")):
154
154
  remote_head = dst
155
155
  line = readline()
156
156
  if line == "":
@@ -18,7 +18,7 @@ info() {
18
18
  }
19
19
 
20
20
  check_env() {
21
- if [[ "$(whoami)" != vagrant ]]; then
21
+ if [[ ! -f /.dockerenv ]]; then
22
22
  if [[ "${CI}" != true ]]; then
23
23
  echo "error: `basename "$0"` should only be used in a Vagrant VM or in CI"
24
24
  exit 2
@@ -1,22 +0,0 @@
1
- # Testing
2
-
3
- When running tests locally, git-remote-dropbox uses [Vagrant] to run tests
4
- inside a virtual machine to completely isolate tests from the host machine.
5
-
6
- ## Running the tests
7
-
8
- Start the VM using `vagrant up`, and SSH into the VM using `vagrant ssh`. The
9
- rest of the commands should be run in the VM.
10
-
11
- The test script requires a Dropbox token to run, because it actually interacts
12
- with the real Dropbox API during the test.
13
-
14
- ```bash
15
- cd /git-remote-dropbox
16
- pip3 install -e .
17
- cd test
18
- export DROPBOX_TOKEN='...'
19
- ./test.sh
20
- ```
21
-
22
- [Vagrant]: https://www.vagrantup.com/
@@ -1,27 +0,0 @@
1
- Vagrant.configure(2) do |config|
2
-
3
- config.vm.box = 'ubuntu/bionic64'
4
-
5
- # synced folder
6
- config.vm.synced_folder '..', '/git-remote-dropbox'
7
-
8
- # disable default synced folder
9
- config.vm.synced_folder '.', '/vagrant', disabled: true
10
-
11
- # install packages
12
- config.vm.provision 'shell', inline: <<-EOS
13
- apt-get -y update
14
- apt-get install -y git python3-pip
15
- EOS
16
-
17
- # alias python -> python3
18
- config.vm.provision 'shell', inline: <<-EOS
19
- sudo ln -s /usr/bin/python3 /usr/bin/python
20
- EOS
21
-
22
- # configure PATH
23
- config.vm.provision 'shell', inline: <<-EOS
24
- echo 'PATH=$HOME/.local/bin:$PATH' > /etc/profile.d/path.sh
25
- EOS
26
-
27
- end