From 246c9bd7406376f6ea46888116cc3ed79367d661 Mon Sep 17 00:00:00 2001 From: guillaume <guillaume@Ubuntu22.myguest.virtualbox.org> Date: Mon, 15 Apr 2024 16:02:26 +0200 Subject: [PATCH] first commit for develop branch --- .gitignore | 46 ++++++++++++ LICENCE | 0 README.md | 95 +++++------------------ docs/index.html | 78 +++++++++++++++++++ docs/main.html | 133 +++++++++++++++++++++++++++++++++ pyproject.toml | 96 ++++++++++++++++++++++++ requirements-dev.txt | 7 ++ requirements.txt | 0 setup.py | 3 + src/library_vision/__init__.py | 10 +++ src/library_vision/file.py | 22 ++++++ tests/__init__.py | 3 + tests/fake_test.py | 25 +++++++ 13 files changed, 442 insertions(+), 76 deletions(-) create mode 100644 .gitignore create mode 100644 LICENCE create mode 100644 docs/index.html create mode 100644 docs/main.html create mode 100644 pyproject.toml create mode 100644 requirements-dev.txt create mode 100644 requirements.txt create mode 100644 setup.py create mode 100644 src/library_vision/__init__.py create mode 100644 src/library_vision/file.py create mode 100644 tests/__init__.py create mode 100644 tests/fake_test.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ddb06da --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +.idea +.DS_Store +wheelhouse +.vscode/targets.log +.vscode/ + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# https://github.com/github/gitignore/blob/e5323759e387ba347a9d50f8b0ddd16502eb71d4/Python.gitignore +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ \ No newline at end of file diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index fb95f5a..a546d72 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,36 @@ # vision +# Installation for development +1. Clone the repository: -## Getting started +```git clone git@gitlab.oca.eu:bcarry/vision.git``` -To make it easy for you to get started with GitLab, here's a list of recommended next steps. -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +2. Create your environement: -## Add your files +```conda create -n YOUR_ENV_NAME``` -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +3. Install your dependencies: -``` -cd existing_repo -git remote add origin https://gitlab.oca.eu/bcarry/vision.git -git branch -M main -git push -uf origin main -``` +```conda install --file requirements-dev.txt``` -## Integrate with your tools +# Main command -- [ ] [Set up project integrations](https://gitlab.oca.eu/bcarry/vision/-/settings/integrations) +build: ```python -m build``` -## Collaborate with your team +docs: ```pdoc --output-dir docs/ --html --force library_vision``` -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) +test: -## Test and Deploy + pytest -Use the built-in continuous integration in GitLab. + OR + + pytest PATH_TO_FILE -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) +coverage: -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README - -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. + coverage run -m pytest + # Make the html version of the coverage results. + coverage html diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..fb8ac70 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,78 @@ +<!doctype html> +<html lang="en"> +<head> +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> +<meta name="generator" content="pdoc 0.10.0" /> +<title>library_vision API documentation</title> +<meta name="description" content="This docstring is used to describe the purpose of the package …" /> +<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin> +<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin> +<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin> +<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style> +<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style> +<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style> +<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script> +<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script> +</head> +<body> +<main> +<article id="content"> +<header> +<h1 class="title">Package <code>library_vision</code></h1> +</header> +<section id="section-intro"> +<p>This docstring is used to describe the purpose of the package.</p> +<p>This will showup on the first page of the pdoc documentation, +and should be adjusted as you best see fit.</p> +<details class="source"> +<summary> +<span>Expand source code</span> +</summary> +<pre><code class="python">""" +This docstring is used to describe the purpose of the package. + +This will showup on the first page of the pdoc documentation, +and should be adjusted as you best see fit. +""" + +from .main import * + +__version__ = "0.0.1"</code></pre> +</details> +</section> +<section> +<h2 class="section-title" id="header-submodules">Sub-modules</h2> +<dl> +<dt><code class="name"><a title="library_vision.file" href="main.html">library_vision.file</a></code></dt> +<dd> +<div class="desc"></div> +</dd> +</dl> +</section> +<section> +</section> +<section> +</section> +<section> +</section> +</article> +<nav id="sidebar"> +<h1>Index</h1> +<div class="toc"> +<ul></ul> +</div> +<ul id="index"> +<li><h3><a href="#header-submodules">Sub-modules</a></h3> +<ul> +<li><code><a title="library_vision.file" href="main.html">library_vision.file</a></code></li> +</ul> +</li> +</ul> +</nav> +</main> +<footer id="footer"> +<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p> +</footer> +</body> +</html> \ No newline at end of file diff --git a/docs/main.html b/docs/main.html new file mode 100644 index 0000000..ff0c6e1 --- /dev/null +++ b/docs/main.html @@ -0,0 +1,133 @@ +<!doctype html> +<html lang="en"> +<head> +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> +<meta name="generator" content="pdoc 0.10.0" /> +<title>library_vision.file API documentation</title> +<meta name="description" content="" /> +<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin> +<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin> +<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin> +<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style> +<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style> +<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style> +<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script> +<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script> +</head> +<body> +<main> +<article id="content"> +<header> +<h1 class="title">Module <code>library_vision.file</code></h1> +</header> +<section id="section-intro"> +<details class="source"> +<summary> +<span>Expand source code</span> +</summary> +<pre><code class="python">def dummy_function(inputs): + """ + This is a dummy function to demonstrate the docstring format + + Parameters + ---------- + inputs : list + A list of inputs to the function. + + Returns + ------- + outputs : list + A list of outputs from the function. + + Notes + ----- + Additional notes about the function can be placed here. + """ + + print(inputs) + + return inputs</code></pre> +</details> +</section> +<section> +</section> +<section> +</section> +<section> +<h2 class="section-title" id="header-functions">Functions</h2> +<dl> +<dt id="library_vision.file.dummy_function"><code class="name flex"> +<span>def <span class="ident">dummy_function</span></span>(<span>inputs)</span> +</code></dt> +<dd> +<div class="desc"><p>This is a dummy function to demonstrate the docstring format</p> +<h2 id="parameters">Parameters</h2> +<dl> +<dt><strong><code>inputs</code></strong> : <code>list</code></dt> +<dd>A list of inputs to the function.</dd> +</dl> +<h2 id="returns">Returns</h2> +<dl> +<dt><strong><code>outputs</code></strong> : <code>list</code></dt> +<dd>A list of outputs from the function.</dd> +</dl> +<h2 id="notes">Notes</h2> +<p>Additional notes about the function can be placed here.</p></div> +<details class="source"> +<summary> +<span>Expand source code</span> +</summary> +<pre><code class="python">def dummy_function(inputs): + """ + This is a dummy function to demonstrate the docstring format + + Parameters + ---------- + inputs : list + A list of inputs to the function. + + Returns + ------- + outputs : list + A list of outputs from the function. + + Notes + ----- + Additional notes about the function can be placed here. + """ + + print(inputs) + + return inputs</code></pre> +</details> +</dd> +</dl> +</section> +<section> +</section> +</article> +<nav id="sidebar"> +<h1>Index</h1> +<div class="toc"> +<ul></ul> +</div> +<ul id="index"> +<li><h3>Super-module</h3> +<ul> +<li><code><a title="library_vision" href="index.html">library_vision</a></code></li> +</ul> +</li> +<li><h3><a href="#header-functions">Functions</a></h3> +<ul class=""> +<li><code><a title="library_vision.file.dummy_function" href="#src/library_vision.file.dummy_function">dummy_function</a></code></li> +</ul> +</li> +</ul> +</nav> +</main> +<footer id="footer"> +<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p> +</footer> +</body> +</html> \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..97b6add --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,96 @@ +#Specify the requirements needed to build the package. +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +#Specify the requirements needed to build the project itself. +#Instructions for defining the project info + +[project] +name = "library_vision" +version = "0.0.1" +authors = [ + { name="Benoit Carry", email="benoit.carry@oca.eu" }, + { name="Guillaume Verbiese", email="guillaume.verbiese@oca.eu" }, +] +description = "A small example package" +readme = "README.md" +requires-python = ">=3.8" +keywords = ["python"] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [] + +[project.urls] +Homepage = "https://gitlab.oca.eu/bcarry/vision" +Issues = "https://gitlab.oca.eu/bcarry/vision/-/issues" + +[project.optional-dependencies] +cli = [ + "rich", + "click", +] + + +# Dynamic metadata - E.g., version here. +# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata +[tool.setuptools.dynamic] +version = {attr = "library_vision.__version__"} + +# setuptools specific items +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] # ["."] by default +include = ["*.py"] # ["*"] by default +exclude = [] # empty by default +namespaces = true # true by default + +# information about "tools" +[tool.isort] +profile = "black" +multi_line_output = 3 +line_length = 100 +include_trailing_comma = true +sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER'] +known_first_party = ["cython_functions"] + +[tool.black] +line-length = 100 +exclude = ''' + +( + /( + \.eggs # exclude a few common directories in the + | \.git # root of the project + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist + )/ +) +''' + +# Information needed for cibuildwheel +[tool.cibuildwheel] +# build options: https://cibuildwheel.readthedocs.io/en/stable/options/#build-selection +build = ["cp37-*", "cp38-*", "cp39-*", "cp310-*"] +skip = ["*-win32", "*i686", "*aarch64", "*ppc64le", "*s390x", "*musllinux*"] + +# testing info: https://cibuildwheel.readthedocs.io/en/stable/options/#testing +test-command = "pytest {project}" +test-requires = ["pytest"] + +# https://github.com/pypa/setuptools_scm/ +# [tool.setuptools_scm] + +[tool.coverage] +run.omit = ["testing/*", "*/*_test.py"] \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..e4882f2 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,7 @@ +pytest +black +isort +wheel +pdoc3 +coverage +build \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6068493 --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup() diff --git a/src/library_vision/__init__.py b/src/library_vision/__init__.py new file mode 100644 index 0000000..79e90b6 --- /dev/null +++ b/src/library_vision/__init__.py @@ -0,0 +1,10 @@ +""" +This docstring is used to describe the purpose of the package. + +This will showup on the first page of the pdoc documentation, +and should be adjusted as you best see fit. +""" + +from .file import * + +__version__ = "0.0.1" \ No newline at end of file diff --git a/src/library_vision/file.py b/src/library_vision/file.py new file mode 100644 index 0000000..5cfb0fc --- /dev/null +++ b/src/library_vision/file.py @@ -0,0 +1,22 @@ +def dummy_function(inputs): + """ + This is a dummy function to demonstrate the docstring format + + Parameters + ---------- + inputs : list + A list of inputs to the function. + + Returns + ------- + outputs : list + A list of outputs from the function. + + Notes + ----- + Additional notes about the function can be placed here. + """ + + print(inputs) + + return inputs diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..47db755 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +import os +import sys +sys.path.insert(0, os.path.abspath( os.path.join(os.path.dirname(__file__), '../src/') )) \ No newline at end of file diff --git a/tests/fake_test.py b/tests/fake_test.py new file mode 100644 index 0000000..39e17b0 --- /dev/null +++ b/tests/fake_test.py @@ -0,0 +1,25 @@ +# {update_here} +from dbm import dumb + + + +import src +from src.library_vision import dummy_function + + +def test_fake_1(timing=False): + if timing is True: + tic = time.time() + + for i in range(10): + assert i == dummy_function(i) + + if timing is True: + toc = time.time() + print("Test took: {}s".format(toc - tic)) + + +if __name__ == "__main__": + import time + + test_fake_1(timing=True) -- GitLab