Skip to content

Commit 57a60c6

Browse files
committedJan 18, 2022
init
0 parents  commit 57a60c6

18 files changed

+1008
-0
lines changed
 

‎.cookiecutter.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"_template": "https://github.com/iterative/py-template",
3+
"author": "Iterative",
4+
"copyright_year": "2022",
5+
"development_status": "Development Status :: 1 - Planning",
6+
"email": "support@dvc.org",
7+
"friendly_name": "DVC objects",
8+
"github_user": "iterative",
9+
"license": "Apache-2.0",
10+
"package_name": "dvc_objects",
11+
"project_name": "dvc-objects",
12+
"short_description": "dvc objects",
13+
"version": "0.0.0"
14+
}

‎.cruft.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"template": "https://github.com/iterative/py-template",
3+
"commit": "e955772b62ccd89ae82d0b5cd50cb8a2158e3a50",
4+
"checkout": null,
5+
"context": {
6+
"cookiecutter": {
7+
"project_name": "dvc-objects",
8+
"package_name": "dvc_objects",
9+
"friendly_name": "DVC objects",
10+
"author": "Iterative",
11+
"email": "support@dvc.org",
12+
"github_user": "iterative",
13+
"version": "0.0.0",
14+
"copyright_year": "2022",
15+
"license": "Apache-2.0",
16+
"short_description": "dvc objects",
17+
"development_status": "Development Status :: 1 - Planning",
18+
"_template": "https://github.com/iterative/py-template"
19+
}
20+
},
21+
"directory": null,
22+
"skip": [
23+
".git"
24+
]
25+
}

‎.github/dependabot.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
updates:
4+
- directory: "/"
5+
package-ecosystem: "pip"
6+
schedule:
7+
interval: "weekly"
8+
labels:
9+
- "maintenance"
10+
11+
- directory: "/"
12+
package-ecosystem: "github-actions"
13+
schedule:
14+
interval: "weekly"
15+
labels:
16+
- "maintenance"

‎.github/workflows/release.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out the repository
12+
uses: actions/checkout@v2
13+
14+
- name: Set up Python 3.7
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: '3.7'
18+
19+
- name: Upgrade pip and nox
20+
run: |
21+
pip install --upgrade pip nox
22+
pip --version
23+
nox --version
24+
25+
- name: Build package
26+
run: nox -s build
27+
28+
- name: Upload package
29+
uses: pypa/gh-action-pypi-publish@master
30+
with:
31+
user: __token__
32+
password: ${{ secrets.PYPI_TOKEN }}

‎.github/workflows/tests.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
timeout-minutes: 10
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-20.04, windows-latest, macos-latest]
13+
pyv: ['3.7', '3.8', '3.9', '3.10']
14+
15+
steps:
16+
- name: Check out the repository
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Python ${{ matrix.pyv }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.pyv }}
23+
24+
- name: Upgrade pip and nox
25+
run: |
26+
pip install --upgrade pip nox
27+
pip --version
28+
nox --version
29+
30+
- name: Lint code and check dependencies
31+
run: nox -s lint safety
32+
33+
- name: Run tests
34+
run: nox -s tests-${{ matrix.pyv }} -- --cov-report=xml
35+
36+
- name: Upload coverage report
37+
uses: codecov/codecov-action@v2.1.0
38+
39+
- name: Build package
40+
run: nox -s build

‎.gitignore

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/

‎.pre-commit-config.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
default_language_version:
2+
python: python3
3+
repos:
4+
- repo: https://github.com/psf/black
5+
rev: 21.11b1
6+
hooks:
7+
- id: black
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v4.0.1
10+
hooks:
11+
- id: check-added-large-files
12+
- id: check-case-conflict
13+
- id: check-docstring-first
14+
- id: check-executables-have-shebangs
15+
- id: check-toml
16+
- id: check-merge-conflict
17+
- id: check-yaml
18+
- id: debug-statements
19+
- id: end-of-file-fixer
20+
- id: mixed-line-ending
21+
- id: sort-simple-yaml
22+
- id: trailing-whitespace
23+
- repo: https://github.com/codespell-project/codespell
24+
rev: v2.1.0
25+
hooks:
26+
- id: codespell
27+
- repo: https://github.com/asottile/pyupgrade
28+
rev: v2.31.0
29+
hooks:
30+
- id: pyupgrade
31+
- repo: https://github.com/PyCQA/isort
32+
rev: 5.10.1
33+
hooks:
34+
- id: isort
35+
- repo: https://gitlab.com/pycqa/flake8
36+
rev: 3.9.2
37+
hooks:
38+
- id: flake8
39+
additional_dependencies:
40+
- flake8-bandit
41+
- flake8-broken-line
42+
- flake8-bugbear
43+
- flake8-comprehensions
44+
- flake8-debugger
45+
- flake8-string-format

‎CODE_OF_CONDUCT.rst

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
Contributor Covenant Code of Conduct
2+
====================================
3+
4+
Our Pledge
5+
----------
6+
7+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
8+
9+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
10+
11+
12+
Our Standards
13+
-------------
14+
15+
Examples of behavior that contributes to a positive environment for our community include:
16+
17+
- Demonstrating empathy and kindness toward other people
18+
- Being respectful of differing opinions, viewpoints, and experiences
19+
- Giving and gracefully accepting constructive feedback
20+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
21+
- Focusing on what is best not just for us as individuals, but for the overall community
22+
23+
Examples of unacceptable behavior include:
24+
25+
- The use of sexualized language or imagery, and sexual attention or
26+
advances of any kind
27+
- Trolling, insulting or derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or email
30+
address, without their explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
Enforcement Responsibilities
35+
----------------------------
36+
37+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
38+
39+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
40+
41+
42+
Scope
43+
-----
44+
45+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
46+
47+
48+
Enforcement
49+
-----------
50+
51+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at support@dvc.org. All complaints will be reviewed and investigated promptly and fairly.
52+
53+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
54+
55+
56+
Enforcement Guidelines
57+
----------------------
58+
59+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
60+
61+
62+
1. Correction
63+
~~~~~~~~~~~~~
64+
65+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
66+
67+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
68+
69+
70+
2. Warning
71+
~~~~~~~~~~
72+
73+
**Community Impact**: A violation through a single incident or series of actions.
74+
75+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
76+
77+
78+
3. Temporary Ban
79+
~~~~~~~~~~~~~~~~
80+
81+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
82+
83+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
84+
85+
86+
4. Permanent Ban
87+
~~~~~~~~~~~~~~~~
88+
89+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
90+
91+
**Consequence**: A permanent ban from any sort of public interaction within the community.
92+
93+
94+
Attribution
95+
-----------
96+
97+
This Code of Conduct is adapted from the `Contributor Covenant <homepage_>`__, version 2.0,
98+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct/.
99+
100+
Community Impact Guidelines were inspired by `Mozilla’s code of conduct enforcement ladder <https://github.com/mozilla/inclusion>`__.
101+
102+
.. _homepage: https://www.contributor-covenant.org
103+
104+
For answers to common questions about this code of conduct, see the FAQ at
105+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

‎CONTRIBUTING.rst

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
Contributor Guide
2+
=================
3+
4+
Thank you for your interest in improving this project.
5+
This project is open-source under the `Apache 2.0 license`_ and
6+
welcomes contributions in the form of bug reports, feature requests, and pull requests.
7+
8+
Here is a list of important resources for contributors:
9+
10+
- `Source Code`_
11+
- `Documentation`_
12+
- `Issue Tracker`_
13+
- `Code of Conduct`_
14+
15+
.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
16+
.. _Source Code: https://github.com/iterative/dvc-objects
17+
.. _Documentation: https://dvc-objects.readthedocs.io/
18+
.. _Issue Tracker: https://github.com/iterative/dvc-objects/issues
19+
20+
How to report a bug
21+
-------------------
22+
23+
Report bugs on the `Issue Tracker`_.
24+
25+
When filing an issue, make sure to answer these questions:
26+
27+
- Which operating system and Python version are you using?
28+
- Which version of this project are you using?
29+
- What did you do?
30+
- What did you expect to see?
31+
- What did you see instead?
32+
33+
The best way to get your bug fixed is to provide a test case,
34+
and/or steps to reproduce the issue.
35+
36+
37+
How to request a feature
38+
------------------------
39+
40+
Request features on the `Issue Tracker`_.
41+
42+
43+
How to set up your development environment
44+
------------------------------------------
45+
46+
You need Python 3.7+ and the following tools:
47+
48+
- Nox_
49+
50+
Install the package with development requirements:
51+
52+
.. code:: console
53+
54+
$ pip install nox
55+
56+
.. _Nox: https://nox.thea.codes/
57+
58+
59+
How to test the project
60+
-----------------------
61+
62+
Run the full test suite:
63+
64+
.. code:: console
65+
66+
$ nox
67+
68+
List the available Nox sessions:
69+
70+
.. code:: console
71+
72+
$ nox --list-sessions
73+
74+
You can also run a specific Nox session.
75+
For example, invoke the unit test suite like this:
76+
77+
.. code:: console
78+
79+
$ nox --session=tests
80+
81+
Unit tests are located in the ``tests`` directory,
82+
and are written using the pytest_ testing framework.
83+
84+
.. _pytest: https://pytest.readthedocs.io/
85+
86+
87+
How to submit changes
88+
---------------------
89+
90+
Open a `pull request`_ to submit changes to this project.
91+
92+
Your pull request needs to meet the following guidelines for acceptance:
93+
94+
- The Nox test suite must pass without errors and warnings.
95+
- Include unit tests. This project maintains 100% code coverage.
96+
- If your changes add functionality, update the documentation accordingly.
97+
98+
Feel free to submit early, though—we can always iterate on this.
99+
100+
To run linting and code formatting checks, you can invoke a `lint` session in nox:
101+
102+
.. code:: console
103+
104+
$ nox -s lint
105+
106+
It is recommended to open an issue before starting work on anything.
107+
This will allow a chance to talk it over with the owners and validate your approach.
108+
109+
.. _pull request: https://github.com/iterative/dvc-objects/pulls
110+
.. github-only
111+
.. _Code of Conduct: CODE_OF_CONDUCT.rst

‎LICENSE

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
Apache License
2+
Version 2.0, January 2004
3+
http://www.apache.org/licenses/
4+
5+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6+
7+
1. Definitions.
8+
9+
"License" shall mean the terms and conditions for use, reproduction,
10+
and distribution as defined by Sections 1 through 9 of this document.
11+
12+
"Licensor" shall mean the copyright owner or entity authorized by
13+
the copyright owner that is granting the License.
14+
15+
"Legal Entity" shall mean the union of the acting entity and all
16+
other entities that control, are controlled by, or are under common
17+
control with that entity. For the purposes of this definition,
18+
"control" means (i) the power, direct or indirect, to cause the
19+
direction or management of such entity, whether by contract or
20+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
21+
outstanding shares, or (iii) beneficial ownership of such entity.
22+
23+
"You" (or "Your") shall mean an individual or Legal Entity
24+
exercising permissions granted by this License.
25+
26+
"Source" form shall mean the preferred form for making modifications,
27+
including but not limited to software source code, documentation
28+
source, and configuration files.
29+
30+
"Object" form shall mean any form resulting from mechanical
31+
transformation or translation of a Source form, including but
32+
not limited to compiled object code, generated documentation,
33+
and conversions to other media types.
34+
35+
"Work" shall mean the work of authorship, whether in Source or
36+
Object form, made available under the License, as indicated by a
37+
copyright notice that is included in or attached to the work
38+
(an example is provided in the Appendix below).
39+
40+
"Derivative Works" shall mean any work, whether in Source or Object
41+
form, that is based on (or derived from) the Work and for which the
42+
editorial revisions, annotations, elaborations, or other modifications
43+
represent, as a whole, an original work of authorship. For the purposes
44+
of this License, Derivative Works shall not include works that remain
45+
separable from, or merely link (or bind by name) to the interfaces of,
46+
the Work and Derivative Works thereof.
47+
48+
"Contribution" shall mean any work of authorship, including
49+
the original version of the Work and any modifications or additions
50+
to that Work or Derivative Works thereof, that is intentionally
51+
submitted to Licensor for inclusion in the Work by the copyright owner
52+
or by an individual or Legal Entity authorized to submit on behalf of
53+
the copyright owner. For the purposes of this definition, "submitted"
54+
means any form of electronic, verbal, or written communication sent
55+
to the Licensor or its representatives, including but not limited to
56+
communication on electronic mailing lists, source code control systems,
57+
and issue tracking systems that are managed by, or on behalf of, the
58+
Licensor for the purpose of discussing and improving the Work, but
59+
excluding communication that is conspicuously marked or otherwise
60+
designated in writing by the copyright owner as "Not a Contribution."
61+
62+
"Contributor" shall mean Licensor and any individual or Legal Entity
63+
on behalf of whom a Contribution has been received by Licensor and
64+
subsequently incorporated within the Work.
65+
66+
2. Grant of Copyright License. Subject to the terms and conditions of
67+
this License, each Contributor hereby grants to You a perpetual,
68+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69+
copyright license to reproduce, prepare Derivative Works of,
70+
publicly display, publicly perform, sublicense, and distribute the
71+
Work and such Derivative Works in Source or Object form.
72+
73+
3. Grant of Patent License. Subject to the terms and conditions of
74+
this License, each Contributor hereby grants to You a perpetual,
75+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76+
(except as stated in this section) patent license to make, have made,
77+
use, offer to sell, sell, import, and otherwise transfer the Work,
78+
where such license applies only to those patent claims licensable
79+
by such Contributor that are necessarily infringed by their
80+
Contribution(s) alone or by combination of their Contribution(s)
81+
with the Work to which such Contribution(s) was submitted. If You
82+
institute patent litigation against any entity (including a
83+
cross-claim or counterclaim in a lawsuit) alleging that the Work
84+
or a Contribution incorporated within the Work constitutes direct
85+
or contributory patent infringement, then any patent licenses
86+
granted to You under this License for that Work shall terminate
87+
as of the date such litigation is filed.
88+
89+
4. Redistribution. You may reproduce and distribute copies of the
90+
Work or Derivative Works thereof in any medium, with or without
91+
modifications, and in Source or Object form, provided that You
92+
meet the following conditions:
93+
94+
(a) You must give any other recipients of the Work or
95+
Derivative Works a copy of this License; and
96+
97+
(b) You must cause any modified files to carry prominent notices
98+
stating that You changed the files; and
99+
100+
(c) You must retain, in the Source form of any Derivative Works
101+
that You distribute, all copyright, patent, trademark, and
102+
attribution notices from the Source form of the Work,
103+
excluding those notices that do not pertain to any part of
104+
the Derivative Works; and
105+
106+
(d) If the Work includes a "NOTICE" text file as part of its
107+
distribution, then any Derivative Works that You distribute must
108+
include a readable copy of the attribution notices contained
109+
within such NOTICE file, excluding those notices that do not
110+
pertain to any part of the Derivative Works, in at least one
111+
of the following places: within a NOTICE text file distributed
112+
as part of the Derivative Works; within the Source form or
113+
documentation, if provided along with the Derivative Works; or,
114+
within a display generated by the Derivative Works, if and
115+
wherever such third-party notices normally appear. The contents
116+
of the NOTICE file are for informational purposes only and
117+
do not modify the License. You may add Your own attribution
118+
notices within Derivative Works that You distribute, alongside
119+
or as an addendum to the NOTICE text from the Work, provided
120+
that such additional attribution notices cannot be construed
121+
as modifying the License.
122+
123+
You may add Your own copyright statement to Your modifications and
124+
may provide additional or different license terms and conditions
125+
for use, reproduction, or distribution of Your modifications, or
126+
for any such Derivative Works as a whole, provided Your use,
127+
reproduction, and distribution of the Work otherwise complies with
128+
the conditions stated in this License.
129+
130+
5. Submission of Contributions. Unless You explicitly state otherwise,
131+
any Contribution intentionally submitted for inclusion in the Work
132+
by You to the Licensor shall be under the terms and conditions of
133+
this License, without any additional terms or conditions.
134+
Notwithstanding the above, nothing herein shall supersede or modify
135+
the terms of any separate license agreement you may have executed
136+
with Licensor regarding such Contributions.
137+
138+
6. Trademarks. This License does not grant permission to use the trade
139+
names, trademarks, service marks, or product names of the Licensor,
140+
except as required for reasonable and customary use in describing the
141+
origin of the Work and reproducing the content of the NOTICE file.
142+
143+
7. Disclaimer of Warranty. Unless required by applicable law or
144+
agreed to in writing, Licensor provides the Work (and each
145+
Contributor provides its Contributions) on an "AS IS" BASIS,
146+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147+
implied, including, without limitation, any warranties or conditions
148+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149+
PARTICULAR PURPOSE. You are solely responsible for determining the
150+
appropriateness of using or redistributing the Work and assume any
151+
risks associated with Your exercise of permissions under this License.
152+
153+
8. Limitation of Liability. In no event and under no legal theory,
154+
whether in tort (including negligence), contract, or otherwise,
155+
unless required by applicable law (such as deliberate and grossly
156+
negligent acts) or agreed to in writing, shall any Contributor be
157+
liable to You for damages, including any direct, indirect, special,
158+
incidental, or consequential damages of any character arising as a
159+
result of this License or out of the use or inability to use the
160+
Work (including but not limited to damages for loss of goodwill,
161+
work stoppage, computer failure or malfunction, or any and all
162+
other commercial damages or losses), even if such Contributor
163+
has been advised of the possibility of such damages.
164+
165+
9. Accepting Warranty or Additional Liability. While redistributing
166+
the Work or Derivative Works thereof, You may choose to offer,
167+
and charge a fee for, acceptance of support, warranty, indemnity,
168+
or other liability obligations and/or rights consistent with this
169+
License. However, in accepting such obligations, You may act only
170+
on Your own behalf and on Your sole responsibility, not on behalf
171+
of any other Contributor, and only if You agree to indemnify,
172+
defend, and hold each Contributor harmless for any liability
173+
incurred by, or claims asserted against, such Contributor by reason
174+
of your accepting any such warranty or additional liability.
175+
176+
END OF TERMS AND CONDITIONS
177+
178+
APPENDIX: How to apply the Apache License to your work.
179+
180+
To apply the Apache License to your work, attach the following
181+
boilerplate notice, with the fields enclosed by brackets "{}"
182+
replaced with your own identifying information. (Don't include
183+
the brackets!) The text should be enclosed in the appropriate
184+
comment syntax for the file format. We also recommend that a
185+
file or class name and description of purpose be included on the
186+
same "printed page" as the copyright notice for easier
187+
identification within third-party archives.
188+
189+
Copyright 2022 Iterative.
190+
191+
Licensed under the Apache License, Version 2.0 (the "License");
192+
you may not use this file except in compliance with the License.
193+
You may obtain a copy of the License at
194+
195+
http://www.apache.org/licenses/LICENSE-2.0
196+
197+
Unless required by applicable law or agreed to in writing, software
198+
distributed under the License is distributed on an "AS IS" BASIS,
199+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200+
See the License for the specific language governing permissions and
201+
limitations under the License.

‎README.rst

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
DVC objects
2+
===========
3+
4+
|PyPI| |Status| |Python Version| |License|
5+
6+
|Tests| |Codecov| |pre-commit| |Black|
7+
8+
.. |PyPI| image:: https://img.shields.io/pypi/v/dvc-objects.svg
9+
:target: https://pypi.org/project/dvc-objects/
10+
:alt: PyPI
11+
.. |Status| image:: https://img.shields.io/pypi/status/dvc-objects.svg
12+
:target: https://pypi.org/project/dvc-objects/
13+
:alt: Status
14+
.. |Python Version| image:: https://img.shields.io/pypi/pyversions/dvc-objects
15+
:target: https://pypi.org/project/dvc-objects
16+
:alt: Python Version
17+
.. |License| image:: https://img.shields.io/pypi/l/dvc-objects
18+
:target: https://opensource.org/licenses/Apache-2.0
19+
:alt: License
20+
.. |Tests| image:: https://github.com/iterative/dvc-objects/workflows/Tests/badge.svg
21+
:target: https://github.com/iterative/dvc-objects/actions?workflow=Tests
22+
:alt: Tests
23+
.. |Codecov| image:: https://codecov.io/gh/iterative/dvc-objects/branch/main/graph/badge.svg
24+
:target: https://app.codecov.io/gh/iterative/dvc-objects
25+
:alt: Codecov
26+
.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
27+
:target: https://github.com/pre-commit/pre-commit
28+
:alt: pre-commit
29+
.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
30+
:target: https://github.com/psf/black
31+
:alt: Black
32+
33+
34+
Features
35+
--------
36+
37+
* TODO
38+
39+
40+
Requirements
41+
------------
42+
43+
* TODO
44+
45+
46+
Installation
47+
------------
48+
49+
You can install *DVC objects* via pip_ from PyPI_:
50+
51+
.. code:: console
52+
53+
$ pip install dvc-objects
54+
55+
56+
Usage
57+
-----
58+
59+
60+
Contributing
61+
------------
62+
63+
Contributions are very welcome.
64+
To learn more, see the `Contributor Guide`_.
65+
66+
67+
License
68+
-------
69+
70+
Distributed under the terms of the `Apache 2.0 license`_,
71+
*DVC objects* is free and open source software.
72+
73+
74+
Issues
75+
------
76+
77+
If you encounter any problems,
78+
please `file an issue`_ along with a detailed description.
79+
80+
81+
.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
82+
.. _PyPI: https://pypi.org/
83+
.. _file an issue: https://github.com/iterative/dvc-objects/issues
84+
.. _pip: https://pip.pypa.io/
85+
.. github-only
86+
.. _Contributor Guide: CONTRIBUTING.rst

‎noxfile.py

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
"""Automation using nox."""
2+
import glob
3+
import os
4+
5+
import nox
6+
7+
nox.options.reuse_existing_virtualenvs = True
8+
nox.options.sessions = "lint", "tests"
9+
locations = "src", "tests"
10+
11+
12+
@nox.session(python=["3.7", "3.8", "3.9", "3.10"])
13+
def tests(session: nox.Session) -> None:
14+
session.install(".[tests]")
15+
session.run(
16+
"pytest",
17+
"--cov",
18+
"--cov-config=pyproject.toml",
19+
*session.posargs,
20+
env={"COVERAGE_FILE": f".coverage.{session.python}"},
21+
)
22+
23+
24+
@nox.session
25+
def lint(session: nox.Session) -> None:
26+
session.install("pre-commit")
27+
session.install("-e", ".[dev]")
28+
29+
args = *(session.posargs or ("--show-diff-on-failure",)), "--all-files"
30+
session.run("pre-commit", "run", *args)
31+
session.run("python", "-m", "mypy")
32+
session.run("python", "-m", "pylint", *locations)
33+
34+
35+
@nox.session
36+
def safety(session: nox.Session) -> None:
37+
"""Scan dependencies for insecure packages."""
38+
session.install(".[dev]")
39+
session.install("safety")
40+
session.run("safety", "check", "--full-report")
41+
42+
43+
@nox.session
44+
def build(session: nox.Session) -> None:
45+
session.install("build", "setuptools", "twine")
46+
session.run("python", "-m", "build")
47+
dists = glob.glob("dist/*")
48+
session.run("twine", "check", *dists, silent=True)
49+
50+
51+
@nox.session
52+
def dev(session: nox.Session) -> None:
53+
"""Sets up a python development environment for the project."""
54+
args = session.posargs or ("venv",)
55+
venv_dir = os.fsdecode(os.path.abspath(args[0]))
56+
57+
session.log(f"Setting up virtual environment in {venv_dir}")
58+
session.install("virtualenv")
59+
session.run("virtualenv", venv_dir, silent=True)
60+
61+
python = os.path.join(venv_dir, "bin/python")
62+
session.run(python, "-m", "pip", "install", "-e", ".[dev]", external=True)

‎pyproject.toml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[build-system]
2+
requires = ["setuptools>=48", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.black]
6+
line-length = 79
7+
include = '\.pyi?$'
8+
exclude = '''
9+
/(
10+
\.eggs
11+
| \.git
12+
| \.hg
13+
| \.mypy_cache
14+
| \.tox
15+
| \.venv
16+
| _build
17+
| buck-out
18+
| build
19+
| dist
20+
)/
21+
'''
22+
23+
[tool.isort]
24+
profile = "black"
25+
known_first_party = ["dvc_objects"]
26+
line_length = 79
27+
28+
[tool.pytest.ini_options]
29+
addopts = "-ra"
30+
31+
[tool.coverage.run]
32+
branch = true
33+
source = ["dvc_objects", "tests"]
34+
35+
[tool.coverage.paths]
36+
source = ["src", "*/site-packages"]
37+
38+
[tool.coverage.report]
39+
show_missing = true
40+
exclude_lines = [
41+
"pragma: no cover",
42+
"if __name__ == .__main__.:",
43+
"if typing.TYPE_CHECKING:",
44+
"if TYPE_CHECKING:",
45+
"raise NotImplementedError",
46+
"raise AssertionError",
47+
"@overload",
48+
]
49+
50+
[tool.mypy]
51+
# Error output
52+
show_column_numbers = true
53+
show_error_codes = true
54+
show_error_context = true
55+
show_traceback = true
56+
pretty = true
57+
check_untyped_defs = false
58+
# Warnings
59+
warn_no_return = true
60+
warn_redundant_casts = true
61+
warn_unreachable = true
62+
files = ["src", "tests"]
63+
64+
[tool.pylint.message_control]
65+
enable = ["c-extension-no-member", "no-else-return"]
66+
67+
[tool.pylint.variables]
68+
dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_"
69+
ignored-argument-names = "_.*|^ignored_|^unused_|args|kwargs"

‎setup.cfg

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[metadata]
2+
description = dvc objects
3+
name = dvc-objects
4+
version = 0.0.0
5+
long_description = file: README.rst
6+
long_description_content_type = text/x-rst
7+
license = Apache-2.0
8+
license_file = LICENSE
9+
url = https://github.com/iterative/dvc-objects
10+
platforms=any
11+
authors = Iterative
12+
maintainer_email = support@dvc.org
13+
classifiers =
14+
Programming Language :: Python :: 3
15+
Programming Language :: Python :: 3.7
16+
Programming Language :: Python :: 3.8
17+
Programming Language :: Python :: 3.9
18+
Programming Language :: Python :: 3.10
19+
Development Status :: 1 - Planning
20+
21+
[options]
22+
python_requires = >=3.7
23+
zip_safe = False
24+
package_dir=
25+
=src
26+
packages = find:
27+
install_requires=
28+
29+
[options.extras_require]
30+
tests =
31+
pytest==6.2.5
32+
pytest-sugar==0.9.4
33+
pytest-cov==3.0.0
34+
pytest-mock==3.6.1
35+
pylint==2.12.2
36+
mypy==0.930
37+
dev =
38+
%(tests)s
39+
40+
[options.packages.find]
41+
exclude =
42+
tests
43+
tests.*
44+
where=src
45+
46+
[flake8]
47+
ignore=
48+
E203, # Whitespace before ':'
49+
E266, # Too many leading '#' for block comment
50+
W503, # Line break occurred before a binary operator
51+
P1, # unindexed parameters in the str.format, see:
52+
# https://pypi.org/project/flake8-string-format/
53+
max_line_length = 79
54+
max-complexity = 15
55+
select = B,C,E,F,W,T4,B902,T,P
56+
show_source = true
57+
count = true

‎src/dvc_objects/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""DVC objects."""

‎src/dvc_objects/py.typed

Whitespace-only changes.

‎tests/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Test suite for the dvc_objects package."""

‎tests/test_dvc_objects.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Tests for `dvc_objects` package."""
2+
3+
4+
def test_something():
5+
"""Test something."""

0 commit comments

Comments
 (0)
Please sign in to comment.