polybind 0.0.1__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.
@@ -0,0 +1 @@
1
+ *.pickle filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,100 @@
1
+ name: wheel
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - master
9
+ release:
10
+ types:
11
+ - published
12
+
13
+ env:
14
+ FORCE_COLOR: 3
15
+
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ build_wheel:
22
+ name: Build Wheel
23
+ # description: Build SDist with Wheel and also run a test
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v3
27
+ with:
28
+ lfs: true
29
+ submodules: true
30
+
31
+ - uses: actions/setup-python@v4
32
+ with:
33
+ python-version: "3.10"
34
+
35
+ - name: Setup Python
36
+ run: pip install -q build pytest-cov
37
+
38
+ - name: Build SDist
39
+ run: python -m build
40
+
41
+ - name: Installing tests requirements
42
+ run: pip install -q -r requirements.txt
43
+
44
+ - name: Run tests
45
+ run: python -m pytest --cov
46
+
47
+ - uses: actions/upload-artifact@v4
48
+ with:
49
+ path: dist/*
50
+ name: wheels
51
+ overwrite: true
52
+
53
+
54
+ pre_release:
55
+ name: Pre-release
56
+ # description: Running linter and checking the wheels
57
+ needs: [ build_wheel ]
58
+ runs-on: ubuntu-latest
59
+ steps:
60
+ - uses: actions/checkout@v3
61
+ - uses: actions/setup-python@v4
62
+ with:
63
+ python-version: "3.x"
64
+
65
+ - uses: actions/download-artifact@v3
66
+ with:
67
+ name: wheels
68
+ path: dist
69
+
70
+ - name: Ruff Check # TODO: remove this
71
+ uses: jpetrucciani/ruff-check@main
72
+
73
+ - name: Check metadata
74
+ run: pipx run twine check dist/*
75
+
76
+
77
+ upload_all:
78
+ name: Release
79
+ # description: Upload if release
80
+ needs: [pre_release]
81
+ runs-on: ubuntu-latest
82
+ if: github.event_name == 'release' && github.event.action == 'published'
83
+
84
+ steps:
85
+ - uses: actions/download-artifact@v3
86
+ with:
87
+ name: wheels
88
+ path: dist
89
+
90
+ - name: Publish package to PyPI
91
+ uses: pypa/gh-action-pypi-publish@release/v1
92
+ with:
93
+ password: ${{ secrets.PYPI_PASSWORD }}
94
+ user: ${{ secrets.PYPI_USERNAME }}
95
+ # repository-url: https://test.pypi.org/legacy/
96
+
97
+
98
+
99
+
100
+
@@ -0,0 +1,128 @@
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
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+
29
+ # Installer logs
30
+ pip-log.txt
31
+ pip-delete-this-directory.txt
32
+
33
+ # Unit test / coverage reports
34
+ htmlcov/
35
+ .tox/
36
+ .coverage
37
+ .coverage.*
38
+ .cache
39
+ nosetests.xml
40
+ coverage.xml
41
+ *.cover
42
+ *.py,cover
43
+ .hypothesis/
44
+
45
+ # Translations
46
+ *.mo
47
+ *.pot
48
+
49
+ # Django stuff:
50
+ *.log
51
+ local_settings.py
52
+ db.sqlite3
53
+
54
+ # Flask stuff:
55
+ instance/
56
+ .webassets-cache
57
+
58
+ # Scrapy stuff:
59
+ .scrapy
60
+
61
+ # Sphinx documentation
62
+ docs/_build/
63
+
64
+ # PyInstaller
65
+ dist/
66
+
67
+ # Jupyter Notebook
68
+ .ipynb_checkpoints
69
+
70
+ # IPython
71
+ profile_default/
72
+ ipython_config.py
73
+
74
+ # pyenv
75
+ .python-version
76
+
77
+ # pipenv
78
+ Pipfile.lock
79
+
80
+ # celery beat schedule file
81
+ celerybeat-schedule
82
+
83
+ # SageMath parsed files
84
+ *.sage.py
85
+
86
+ # Environments
87
+ .env
88
+ .venv
89
+ env/
90
+ venv/
91
+ ENV/
92
+
93
+ # Spyder project settings
94
+ .spyderproject
95
+ .spyproject
96
+
97
+ # Rope project settings
98
+ .ropeproject
99
+
100
+ # Sublime Text
101
+ *.sublime-workspace
102
+
103
+ # VS Code
104
+ .vscode/
105
+
106
+ # PyCharm
107
+ .idea/
108
+
109
+ # macOS
110
+ .DS_Store
111
+
112
+ # Windows
113
+ Thumbs.db
114
+ desktop.ini
115
+
116
+ # Jupyter Notebook
117
+ .ipynb_checkpoints
118
+
119
+ # pyenv
120
+ .python-version
121
+
122
+ # pipenv
123
+ Pipfile.lock
124
+
125
+ # poetry
126
+ poetry.lock
127
+
128
+ build/
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Mohammad Raziei mohammadraziei1375@gmail.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: polybind
3
+ Version: 0.0.1
4
+ Project-URL: Source, https://github.com/mohammadraziei/polybind
5
+ Project-URL: Issues, https://github.com/mohammadraziei/polybind/issues
6
+ Project-URL: Documentation, https://mohammadraziei.github.io/polybind
7
+ Author-email: Mohammad Raziei <mohammadraziei1375@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE.txt
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.7
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: Implementation :: CPython
23
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
24
+ Requires-Python: >=3.7
25
+ Requires-Dist: numpy
26
+ Description-Content-Type: text/markdown
27
+
28
+ # polybind
29
+
30
+ <!--[![PyPI - Version](https://img.shields.io/pypi/v/behsan-text-to-vec.svg)](https://pypi.org/project/behsan-text-to-vec)
31
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/behsan-text-to-vec.svg)](https://pypi.org/project/behsan-text-to-vec)
32
+ -->
33
+ -----
34
+
35
+ **Table of Contents**
36
+
37
+ - [Installation](#installation)
38
+ - [License](#license)
39
+
40
+ ## Installation
41
+
42
+ ```console
43
+ pip install polybind
44
+ ```
45
+
46
+ ## License
47
+
48
+ `polybind` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -0,0 +1,21 @@
1
+ # polybind
2
+
3
+ <!--[![PyPI - Version](https://img.shields.io/pypi/v/behsan-text-to-vec.svg)](https://pypi.org/project/behsan-text-to-vec)
4
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/behsan-text-to-vec.svg)](https://pypi.org/project/behsan-text-to-vec)
5
+ -->
6
+ -----
7
+
8
+ **Table of Contents**
9
+
10
+ - [Installation](#installation)
11
+ - [License](#license)
12
+
13
+ ## Installation
14
+
15
+ ```console
16
+ pip install polybind
17
+ ```
18
+
19
+ ## License
20
+
21
+ `polybind` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -0,0 +1 @@
1
+ __version__ = "0.0.1"
@@ -0,0 +1,3 @@
1
+ from .__about__ import __version__
2
+ from .core import cat
3
+
@@ -0,0 +1,5 @@
1
+ import numpy as np
2
+
3
+
4
+ def cat(arr1, arr2):
5
+ return np.concatenate([arr1, arr2])
@@ -0,0 +1,2 @@
1
+
2
+
@@ -0,0 +1,189 @@
1
+ [build-system]
2
+ requires = ["hatchling", "hatch-requirements-txt"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "polybind"
7
+ dynamic = ["version", "dependencies"]
8
+ description = ""
9
+ readme = "README.md"
10
+ requires-python = ">=3.7"
11
+ license = "MIT"
12
+ keywords = []
13
+ authors = [
14
+ { name = "Mohammad Raziei", email = "mohammadraziei1375@gmail.com" },
15
+ ]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Operating System :: OS Independent",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python",
21
+ "Programming Language :: Python :: 3 :: Only",
22
+ "Programming Language :: Python :: 3.7",
23
+ "Programming Language :: Python :: 3.8",
24
+ "Programming Language :: Python :: 3.9",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: Implementation :: CPython",
30
+ "Programming Language :: Python :: Implementation :: PyPy",
31
+ ]
32
+
33
+ #dependencies = []
34
+ [tool.hatch.metadata.hooks.requirements_txt]
35
+ files = ["requirements.txt"]
36
+
37
+ [project.urls]
38
+ Source = "https://github.com/mohammadraziei/polybind"
39
+ Issues = "https://github.com/mohammadraziei/polybind/issues"
40
+ Documentation = "https://mohammadraziei.github.io/polybind"
41
+
42
+
43
+ [tool.hatch.version]
44
+ path = "polybind/__about__.py"
45
+
46
+ [tool.hatch.build.targets.wheel]
47
+ packages = ["polybind"]
48
+
49
+ [tool.hatch.envs.default]
50
+ dependencies = [
51
+ "coverage[toml]>=6.5",
52
+ "pytest",
53
+ ]
54
+ [tool.hatch.envs.default.scripts]
55
+ test = "pytest {args:tests}"
56
+ test-cov = "coverage run -m pytest {args:tests}"
57
+ cov-report = [
58
+ "- coverage combine",
59
+ "coverage report",
60
+ ]
61
+ cov = [
62
+ "test-cov",
63
+ "cov-report",
64
+ ]
65
+
66
+ [[tool.hatch.envs.all.matrix]]
67
+ python = ["3.7", "3.8", "3.9", "3.10", "3.11"]
68
+
69
+ [tool.hatch.envs.lint]
70
+ detached = true
71
+ dependencies = [
72
+ "black>=23.1.0",
73
+ "mypy>=1.0.0",
74
+ "ruff>=0.0.243",
75
+ ]
76
+
77
+ [tool.hatch.envs.lint.scripts]
78
+ typing = "mypy --install-types --non-interactive {args:polybind tests}"
79
+ style = [
80
+ "ruff check {args:.}",
81
+ "black --check --diff {args:.}",
82
+ ]
83
+ fmt = [
84
+ "black {args:.}",
85
+ "ruff --fix {args:.}",
86
+ "style",
87
+ ]
88
+ all = [
89
+ "style",
90
+ "typing",
91
+ ]
92
+
93
+ [tool.black]
94
+ target-version = ["py37"]
95
+ line-length = 120
96
+ skip-string-normalization = true
97
+
98
+ [tool.pytest.ini_options]
99
+ minversion = "6.0"
100
+ addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
101
+ xfail_strict = true
102
+ filterwarnings = [
103
+ # "error",
104
+ "ignore:(ast.Str|Attribute s|ast.NameConstant|ast.Num) is deprecated:DeprecationWarning:_pytest", # Python 3.12
105
+ ]
106
+ testpaths = ["tests"]
107
+ pythonpath = [
108
+ "."
109
+ ]
110
+
111
+
112
+ [tool.ruff]
113
+ target-version = "py37"
114
+ line-length = 120
115
+
116
+ [tool.ruff.lint] # Ruff linting configuration
117
+ select = [ # List of lint rule codes to enable
118
+ "A", # Built-in rules for potential errors
119
+ "ARG", # Argument-related checks
120
+ "B", # Bugbear: likely bugs and design problems
121
+ "C", # Complexity checks
122
+ "DTZ", # Datetime-related issues
123
+ "E", "EM", # pycodestyle errors, error messages
124
+ "F", "FBT", # Pyflakes, boolean trap checks
125
+ "I", "ICN", "ISC", # Import sorting, conventions, string concatenation
126
+ "N", # Naming conventions
127
+ "PLC", "PLE", "PLR", "PLW", # Pylint checks (convention, error, refactor, warning)
128
+ "Q", # Quotes
129
+ "RUF", # Ruff-specific rules
130
+ "S", # Security issues
131
+ "T", "TID", # Type annotations, tidy imports
132
+ "UP", # pyupgrade: modernize code
133
+ "W", # pycodestyle warnings
134
+ "YTT", # sys.version checks
135
+ ]
136
+ ignore = [
137
+ # Allow non-abstract empty methods in abstract base classes
138
+ "B027",
139
+ # Allow boolean positional values in function calls, like `dict.get(... True)`
140
+ "FBT003",
141
+ # Ignore checks for possible passwords
142
+ "S105", "S106", "S107",
143
+ # Ignore complexity
144
+ "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
145
+ # Ignore some unsecure rules:
146
+ "S301",
147
+ # Ignore relative imports
148
+ "TID252"
149
+ ]
150
+ unfixable = [
151
+ # Don't touch unused imports
152
+ "F401",
153
+ ]
154
+
155
+ [tool.ruff.lint.isort]
156
+ known-first-party = ["polybind"]
157
+
158
+ [tool.ruff.lint.flake8-tidy-imports]
159
+ ban-relative-imports = "all"
160
+
161
+ [tool.ruff.lint.per-file-ignores]
162
+ # Tests can use magic values, assertions, and relative imports
163
+ "tests/**/*" = ["PLR2004", "S101", "TID252", "E501", "F401"]
164
+ "__init__.py" = ["F401"]
165
+
166
+ [tool.coverage.run]
167
+ source_pkgs = ["polybind"]
168
+ branch = true
169
+ parallel = true
170
+ omit = [
171
+ "polybind/__about__.py",
172
+ ]
173
+
174
+
175
+ [tool.coverage.paths]
176
+ polybind = ["polybind"]
177
+ tests = ["tests"]
178
+
179
+ [tool.coverage.report]
180
+ exclude_lines = [
181
+ "no cov",
182
+ "if __name__ == .__main__.:",
183
+ "if TYPE_CHECKING:",
184
+ "__version__ = "
185
+ ]
186
+
187
+
188
+ [tool.coverage.html]
189
+ directory = "coverage_html_report"
@@ -0,0 +1 @@
1
+ numpy
@@ -0,0 +1,9 @@
1
+ import numpy as np
2
+ import pytest
3
+
4
+ from polybind import cat
5
+
6
+
7
+ def test_cat():
8
+ assert np.equal([1, 2, 3, 4], cat([1, 2], [3, 4])).all()
9
+