ocea 2.0.8.dev2__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 (61) hide show
  1. ocea-2.0.8.dev2/.gitignore +70 -0
  2. ocea-2.0.8.dev2/.pre-commit-config.yaml +31 -0
  3. ocea-2.0.8.dev2/.readthedocs.yml +27 -0
  4. ocea-2.0.8.dev2/AUTHORS.rst +5 -0
  5. ocea-2.0.8.dev2/CHANGELOG.rst +72 -0
  6. ocea-2.0.8.dev2/CONTRIBUTING.rst +182 -0
  7. ocea-2.0.8.dev2/LICENSE.txt +21 -0
  8. ocea-2.0.8.dev2/MANIFEST.in +5 -0
  9. ocea-2.0.8.dev2/PKG-INFO +307 -0
  10. ocea-2.0.8.dev2/README.rst +263 -0
  11. ocea-2.0.8.dev2/docs/Makefile +29 -0
  12. ocea-2.0.8.dev2/docs/_static/.gitignore +1 -0
  13. ocea-2.0.8.dev2/docs/authors.rst +2 -0
  14. ocea-2.0.8.dev2/docs/changelog.rst +2 -0
  15. ocea-2.0.8.dev2/docs/conf.py +281 -0
  16. ocea-2.0.8.dev2/docs/contributing.rst +1 -0
  17. ocea-2.0.8.dev2/docs/index.rst +26 -0
  18. ocea-2.0.8.dev2/docs/license.rst +7 -0
  19. ocea-2.0.8.dev2/docs/readme.rst +2 -0
  20. ocea-2.0.8.dev2/docs/requirements.txt +5 -0
  21. ocea-2.0.8.dev2/docs/usage.rst +623 -0
  22. ocea-2.0.8.dev2/pyproject.toml +101 -0
  23. ocea-2.0.8.dev2/setup.cfg +4 -0
  24. ocea-2.0.8.dev2/src/ocea/__init__.py +8 -0
  25. ocea-2.0.8.dev2/src/ocea/__main__.py +6 -0
  26. ocea-2.0.8.dev2/src/ocea/_version.py +34 -0
  27. ocea-2.0.8.dev2/src/ocea/api.py +281 -0
  28. ocea-2.0.8.dev2/src/ocea/cli.py +90 -0
  29. ocea-2.0.8.dev2/src/ocea/commands/__init__.py +11 -0
  30. ocea-2.0.8.dev2/src/ocea/commands/down.py +229 -0
  31. ocea-2.0.8.dev2/src/ocea/commands/list_cmd.py +305 -0
  32. ocea-2.0.8.dev2/src/ocea/commands/new.py +115 -0
  33. ocea-2.0.8.dev2/src/ocea/commands/reboot.py +137 -0
  34. ocea-2.0.8.dev2/src/ocea/commands/snap.py +269 -0
  35. ocea-2.0.8.dev2/src/ocea/commands/status.py +188 -0
  36. ocea-2.0.8.dev2/src/ocea/commands/up.py +651 -0
  37. ocea-2.0.8.dev2/src/ocea/config.py +127 -0
  38. ocea-2.0.8.dev2/src/ocea/models/__init__.py +17 -0
  39. ocea-2.0.8.dev2/src/ocea/models/action.py +58 -0
  40. ocea-2.0.8.dev2/src/ocea/models/base.py +64 -0
  41. ocea-2.0.8.dev2/src/ocea/models/droplet.py +53 -0
  42. ocea-2.0.8.dev2/src/ocea/models/floating_ip.py +37 -0
  43. ocea-2.0.8.dev2/src/ocea/models/snapshot.py +41 -0
  44. ocea-2.0.8.dev2/src/ocea/services/__init__.py +6 -0
  45. ocea-2.0.8.dev2/src/ocea/services/database.py +553 -0
  46. ocea-2.0.8.dev2/src/ocea/services/digitalocean.py +580 -0
  47. ocea-2.0.8.dev2/src/ocea.egg-info/PKG-INFO +307 -0
  48. ocea-2.0.8.dev2/src/ocea.egg-info/SOURCES.txt +59 -0
  49. ocea-2.0.8.dev2/src/ocea.egg-info/dependency_links.txt +1 -0
  50. ocea-2.0.8.dev2/src/ocea.egg-info/entry_points.txt +2 -0
  51. ocea-2.0.8.dev2/src/ocea.egg-info/requires.txt +19 -0
  52. ocea-2.0.8.dev2/src/ocea.egg-info/top_level.txt +1 -0
  53. ocea-2.0.8.dev2/tests/README.md +55 -0
  54. ocea-2.0.8.dev2/tests/integration/test_cli_integration.py +149 -0
  55. ocea-2.0.8.dev2/tests/integration/test_layout.py +12 -0
  56. ocea-2.0.8.dev2/tests/unit/test_cli.py +1061 -0
  57. ocea-2.0.8.dev2/tests/unit/test_config.py +128 -0
  58. ocea-2.0.8.dev2/tests/unit/test_database.py +387 -0
  59. ocea-2.0.8.dev2/tests/unit/test_import.py +7 -0
  60. ocea-2.0.8.dev2/tests/unit/test_models.py +238 -0
  61. ocea-2.0.8.dev2/tox.ini +92 -0
@@ -0,0 +1,70 @@
1
+ # Temporary and binary files
2
+ *~
3
+ *.py[cod]
4
+ *.so
5
+ *.cfg
6
+ !.isort.cfg
7
+ !setup.cfg
8
+ *.orig
9
+ *.log
10
+ *.pot
11
+ __pycache__/*
12
+ .cache/*
13
+ .*.swp
14
+ */.ipynb_checkpoints/*
15
+ .DS_Store
16
+
17
+ # Project files
18
+ .ropeproject
19
+ .project
20
+ .pydevproject
21
+ .settings
22
+ .idea
23
+ .vscode
24
+ tags
25
+
26
+ # Package files
27
+ *.egg
28
+ *.eggs/
29
+ .installed.cfg
30
+ *.egg-info
31
+
32
+ # Unittest and coverage
33
+ htmlcov/*
34
+ .coverage
35
+ .coverage.*
36
+ .tox
37
+ junit*.xml
38
+ coverage.xml
39
+ .pytest_cache/
40
+
41
+ # Build and docs folder/files
42
+ build/*
43
+ dist/*
44
+ sdist/*
45
+ docs/api/*
46
+ docs/_rst/*
47
+ docs/_build/*
48
+ cover/*
49
+ MANIFEST
50
+
51
+ # Per-project virtualenvs
52
+ .venv*/
53
+ .conda*/
54
+ .python-version
55
+ # Generated by setuptools_scm
56
+ src/ocea/_version.py
57
+
58
+ # Environment and secrets
59
+ .env
60
+ .env.*
61
+
62
+ # Database files
63
+ *.db
64
+
65
+ # Claude Code
66
+ .claude/
67
+
68
+ # Build stamps
69
+ .stamps/
70
+ __pycache__/
@@ -0,0 +1,31 @@
1
+ ci:
2
+ autoupdate_schedule: quarterly
3
+ autofix_prs: true
4
+ autofix_commit_msg: "style: auto-fix formatting [pre-commit.ci]"
5
+
6
+ default_language_version:
7
+ python: python3.12
8
+
9
+ repos:
10
+ - repo: https://github.com/astral-sh/ruff-pre-commit
11
+ rev: v0.6.9 # pin to a tag; update as needed
12
+ hooks:
13
+ - id: ruff
14
+ args: [--fix] # Auto-fix without failing
15
+ - id: ruff-format
16
+
17
+ - repo: https://github.com/pre-commit/pre-commit-hooks
18
+ rev: v4.6.0 # pin to a tag; update as needed
19
+ hooks:
20
+ - id: check-added-large-files
21
+ - id: end-of-file-fixer
22
+ - id: trailing-whitespace
23
+ - id: check-merge-conflict
24
+
25
+
26
+ # If you want Black as well, uncomment this block and keep its rev pinned
27
+ # - repo: https://github.com/psf/black
28
+ # rev: 24.10.0 # example pinned release
29
+ # hooks:
30
+ # - id: black
31
+ # args: ["--line-length=100"]
@@ -0,0 +1,27 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ # Required
5
+ version: 2
6
+
7
+ # Build documentation in the docs/ directory with Sphinx
8
+ sphinx:
9
+ configuration: docs/conf.py
10
+
11
+ # Build documentation with MkDocs
12
+ #mkdocs:
13
+ # configuration: mkdocs.yml
14
+
15
+ # Optionally build your docs in additional formats such as PDF
16
+ formats:
17
+ - pdf
18
+
19
+ build:
20
+ os: ubuntu-22.04
21
+ tools:
22
+ python: "3.11"
23
+
24
+ python:
25
+ install:
26
+ - requirements: docs/requirements.txt
27
+ - {path: ., method: pip}
@@ -0,0 +1,5 @@
1
+ ============
2
+ Contributors
3
+ ============
4
+
5
+ * Kevin Steptoe <kevin.steptoe@gmail.com>
@@ -0,0 +1,72 @@
1
+ =========
2
+ Changelog
3
+ =========
4
+
5
+ Version 2.0.7
6
+ ==============
7
+
8
+ * Always-on spinner and interactive reserved IP selection for ``ocea up``
9
+ * Verify droplet exists in API before acting on stale DB status
10
+ * Fix ``PYTHON_SYS`` fallback to try ``python3`` before Windows-only ``py`` launcher
11
+
12
+ Version 2.0.6
13
+ ==============
14
+
15
+ * Strip DO auto-generated size/region suffix from droplet names
16
+
17
+ Version 2.0.5
18
+ ==============
19
+
20
+ * Replace progress line spam with Rich spinners for long waits
21
+
22
+ Version 2.0.4
23
+ ==============
24
+
25
+ * Fix restore from snapshot ID when DB has old snowballed name
26
+
27
+ Version 2.0.3
28
+ ==============
29
+
30
+ * Increase IP assignment timeout from 2 to 10 minutes for larger droplets
31
+
32
+ Version 2.0.2
33
+ ==============
34
+
35
+ * Fix snapshot name snowballing and increase snapshot timeout
36
+
37
+ Version 2.0.1
38
+ ==============
39
+
40
+ * Fix snapshot lifecycle: wait for completion before destroying droplet
41
+
42
+ Version 2.0.0
43
+ ==============
44
+
45
+ * Add ``reboot`` command for droplets
46
+ * Refactor ``snap`` command to use subcommands (``snap create``, ``snap list``, ``snap delete``)
47
+ * Add snapshot ID support to ``ocea up`` command
48
+ * Add in-progress snapshot actions to ``list`` command
49
+ * Add cleanup for duplicate archived droplets
50
+ * Refactor ``ocea list`` to show droplets and snapshots with filters
51
+ * Wait for droplet to be active before assigning reserved IP
52
+ * Fix reserved IP not assigned when restoring from snapshot ID
53
+ * Comprehensive database tracking and smart restore
54
+ * Pre-commit CI configuration
55
+
56
+ Version 1.0.1
57
+ =============
58
+
59
+ * Added comprehensive database tracking for all operations
60
+ * Added action audit logging
61
+ * Added floating/reserved IP tracking and automatic reassignment
62
+ * Changed ``ocea snap --delete`` to accept multiple snapshot IDs
63
+ * Added ``-h`` help flag to all commands
64
+
65
+ Version 1.0.0
66
+ =============
67
+
68
+ * Initial release
69
+ * Commands: list, status, up, down, new, snap
70
+ * Local SQLite database for inventory tracking
71
+ * Support for snapshots and restore operations
72
+ * JSON output for scripting
@@ -0,0 +1,182 @@
1
+ ============
2
+ Contributing
3
+ ============
4
+
5
+ Welcome to ``ocea``'s contributor's guide.
6
+
7
+ This document focuses on getting any potential contributor familiarized
8
+ with the development processes, but `other kinds of contributions`_ are also
9
+ appreciated.
10
+
11
+ If you are new to using git_ or have never collaborated in a project previously,
12
+ please have a look at `contribution-guide.org`_. Other resources are also
13
+ listed in the excellent `guide created by FreeCodeCamp`_ [#contrib1]_.
14
+
15
+ Please notice, all users and contributors are expected to be **open,
16
+ considerate, reasonable, and respectful**. When in doubt, `Python Software
17
+ Foundation's Code of Conduct`_ is a good reference in terms of behavior
18
+ guidelines.
19
+
20
+
21
+ Issue Reports
22
+ =============
23
+
24
+ If you experience bugs or general issues with ``ocea``, please have a look
25
+ on the `issue tracker`_. If you don't see anything useful there, please feel
26
+ free to fire an issue report.
27
+
28
+ .. tip::
29
+ Please don't forget to include the closed issues in your search.
30
+ Sometimes a solution was already reported, and the problem is considered
31
+ **solved**.
32
+
33
+ New issue reports should include information about your programming environment
34
+ (e.g., operating system, Python version) and steps to reproduce the problem.
35
+ Please try also to simplify the reproduction steps to a very minimal example
36
+ that still illustrates the problem you are facing. By removing other factors,
37
+ you help us to identify the root cause of the issue.
38
+
39
+
40
+ Code Contributions
41
+ ==================
42
+
43
+ Submit an issue
44
+ ---------------
45
+
46
+ Before you work on any non-trivial code contribution it's best to first create
47
+ a report in the `issue tracker`_ to start a discussion on the subject.
48
+ This often provides additional considerations and avoids unnecessary work.
49
+
50
+ Create an environment
51
+ ---------------------
52
+
53
+ Before you start coding, we recommend creating an isolated `virtual
54
+ environment`_ to avoid any problems with your installed Python packages.
55
+ The easiest way is to use the provided Makefile::
56
+
57
+ make bootstrap # Create virtualenv and install dependencies
58
+ make precommit # Install pre-commit hooks
59
+
60
+ Or manually::
61
+
62
+ python3 -m venv .venv
63
+ source .venv/bin/activate
64
+ pip install -e ".[dev]"
65
+
66
+ Clone the repository
67
+ --------------------
68
+
69
+ #. Fork the project repository_: click on the *Fork* button near the top of the
70
+ page. This creates a copy of the code under your account on GitHub.
71
+ #. Clone this copy to your local disk::
72
+
73
+ git clone git@github.com:YourLogin/ocea.git
74
+ cd ocea
75
+
76
+ #. Install the project in editable mode with development dependencies::
77
+
78
+ pip install -e ".[dev]"
79
+
80
+ #. Install pre-commit hooks::
81
+
82
+ pre-commit install
83
+
84
+ Implement your changes
85
+ ----------------------
86
+
87
+ #. Create a branch to hold your changes::
88
+
89
+ git checkout -b my-feature
90
+
91
+ and start making changes. Never work on the main branch!
92
+
93
+ #. When you're done editing, do::
94
+
95
+ git add <MODIFIED FILES>
96
+ git commit
97
+
98
+ to record your changes in git_.
99
+
100
+ Please make sure to see the validation messages from ``pre-commit`` and fix
101
+ any eventual issues. The project uses Ruff_ for linting and formatting.
102
+
103
+ .. important:: Don't forget to add unit tests and documentation in case your
104
+ contribution adds an additional feature and is not just a bugfix.
105
+
106
+ #. Please check that your changes don't break any unit tests with::
107
+
108
+ make test
109
+
110
+ Submit your contribution
111
+ ------------------------
112
+
113
+ #. If everything works fine, push your local branch to GitHub with::
114
+
115
+ git push -u origin my-feature
116
+
117
+ #. Go to the web page of your fork and click "Create pull request"
118
+ to send your changes for review.
119
+
120
+
121
+ Troubleshooting
122
+ ---------------
123
+
124
+ The following tips can be used when facing problems to build or test the
125
+ package:
126
+
127
+ #. Make sure to fetch all the tags from the upstream repository_.
128
+ The command ``git describe --abbrev=0 --tags`` should return the version you
129
+ are expecting.
130
+
131
+ #. If you find any problems with missing dependencies, try recreating the
132
+ virtual environment::
133
+
134
+ rm -rf .venv
135
+ make bootstrap
136
+
137
+
138
+ Maintainer tasks
139
+ ================
140
+
141
+ Releases
142
+ --------
143
+
144
+ If you are part of the group of maintainers and have correct user permissions
145
+ on PyPI_, the following steps can be used to release a new version for
146
+ ``ocea``:
147
+
148
+ #. Make sure all unit tests are successful.
149
+ #. Tag the current commit on the main branch with a release tag, e.g., ``v1.2.3``.
150
+ #. Push the new tag to the upstream repository_, e.g., ``git push upstream v1.2.3``
151
+ #. Clean up the ``dist`` and ``build`` folders with ``tox -e clean``
152
+ (or ``rm -rf dist build``)
153
+ #. Run ``tox -e build`` and check that the files in ``dist`` have
154
+ the correct version (no ``.dirty`` or git_ hash) according to the git_ tag.
155
+ #. Run ``tox -e publish -- --repository pypi`` and check that everything was
156
+ uploaded to PyPI_ correctly.
157
+
158
+
159
+
160
+ .. [#contrib1] Even though, these resources focus on open source projects and
161
+ communities, the general ideas behind collaborating with other developers
162
+ to collectively create software are general and can be applied to all sorts
163
+ of environments, including private companies and proprietary code bases.
164
+
165
+
166
+ .. |the repository service| replace:: GitHub
167
+ .. |contribute button| replace:: "Create pull request"
168
+
169
+ .. _repository: https://github.com/ksteptoe/ocea
170
+ .. _issue tracker: https://github.com/ksteptoe/ocea/issues
171
+
172
+
173
+ .. _contribution-guide.org: https://www.contribution-guide.org/
174
+ .. _creating a PR: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
175
+ .. _git: https://git-scm.com
176
+ .. _guide created by FreeCodeCamp: https://github.com/FreeCodeCamp/how-to-contribute-to-open-source
177
+ .. _other kinds of contributions: https://opensource.guide/how-to-contribute
178
+ .. _pre-commit: https://pre-commit.com/
179
+ .. _PyPI: https://pypi.org/
180
+ .. _Python Software Foundation's Code of Conduct: https://www.python.org/psf/conduct/
181
+ .. _Ruff: https://docs.astral.sh/ruff/
182
+ .. _virtual environment: https://realpython.com/python-virtual-environments-a-primer/
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Kevin Steptoe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ exclude CLAUDE.md
2
+ exclude coverage.xml
3
+ exclude Makefile
4
+ prune .github
5
+ prune .stamps