Skip to content

Commit

Permalink
Commit Subject: Add workflow for publishing to PyPI.org
Browse files Browse the repository at this point in the history
Commit Description:
  • Loading branch information
Jack Hopkins committed Oct 31, 2023
1 parent 1b1188c commit 75af39a
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish to PyPI.org
on:
release:
types: [published]
jobs:
pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: python3 -m pip install --upgrade build && python3 -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.poetry]
name = "monkey-patch.py"
version = "0.1.0"
description = "A Python package for adding typed LLM features to your applications."
authors = ["Jack Hopkins <[email protected]", "Mart Bakler <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.8"
pydantic= "^1.8.2"
appdirs= "1.4.4"
openai = "0.28.1"
numpy = "1.24.4"
python-dotenv= "1.0.0"
bitarray = "2.8.2"
pydantic = "2.4.2"
# Add your project dependencies here, for example:
# requests = "^2.25.1"

[tool.poetry.dev-dependencies]
pytest = "^6.2"
fastapi = "0.104.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

[[tool.poetry.source]]
name = "monkey-patch.py"
url = "https://github.com/monkey-patch-sdk/monkey-patch.py"
secondary = true
31 changes: 31 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[metadata]
name = monkey-patch.py
version = 0.1.0
author = Jack Hopkins
author_email = [email protected]
description = A Python package for adding typed LLM features to your applications.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/monkey-patch-sdk/monkey-patch.py
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent

[options]
package_dir =
= src
packages = find:
python_requires = >=3.6
install_requires =
pydantic>=1.8.2
appdirs~=1.4.4
openai==0.28.1
numpy~=1.24.4
python-dotenv==1.0.0
bitarray==2.8.2
pydantic==2.4.2


[options.packages.find]
where = src
4 changes: 2 additions & 2 deletions src/assertion_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def eval_kwargs(keywords, scope):
# elif func_name == "datetime":
# return datetime.datetime(*args, **kwargs)
_globals = globals()
_function_globals = self.local_scope[self.wrapper_alias].__globals__
_function_globals = self.local_scope[self.wrapper_alias].__globals__ if self.wrapper_alias in self.local_scope else {}
# Generalized object instantiation
if func_name in self.imported_modules:
module = self.imported_modules[func_name]
Expand All @@ -262,7 +262,7 @@ def eval_kwargs(keywords, scope):
func_name = node.func.attr
# obj = self.extract_output(node.func.value, scope)
_globals = globals()
_function_globals = self.local_scope[self.wrapper_alias].__globals__
_function_globals = self.local_scope[self.wrapper_alias].__globals__ if self.wrapper_alias in self.local_scope else {}
if isinstance(node.func.value, ast.Name):
module_or_class_name = node.func.value.id
# Check if module_or_class_name is an imported module
Expand Down
2 changes: 1 addition & 1 deletion tests/test_assertion_visitor/test_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ def test_iteration():

if __name__ == "__main__":
test_equality()
test_rl_equality()
test_iteration()
test_non_equality()
test_none()
test_not_none()
test_inclusion()
test_exclusion()
test_tuple_iteration()
test_rl_equality()

6 changes: 3 additions & 3 deletions tests/test_validator/test_instantiate.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ class ExtendedList(List[int]):


if __name__ == "__main__":
test_generics()
test_extended_generics()
test_instantiate_pydantic()
test_instantiate_dataclass()
test_primitives()
test_primitives()
test_generics()
test_extended_generics()

0 comments on commit 75af39a

Please sign in to comment.