Skip to content

Commit

Permalink
Merge pull request #6 from Zozi96/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Zozi96 authored Aug 6, 2024
2 parents fb6bbdb + 5ff0387 commit 20310c5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
python -m build
python -m twine upload dist/*
17 changes: 17 additions & 0 deletions linq/linq.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,20 @@ def batch_generator(iterable: Iterable[T], size: int) -> Generator[Tuple[T, ...]
batcher = batched

return Linq(batcher(self.iterable, size))

def __iter__(self) -> Iterator[T]:
"""
Returns an iterator for the iterable.
Returns:
Iterator[T]: An iterator for the iterable.
Example:
>>> linq = Linq([1, 2, 3])
>>> for item in linq:
... print(item)
1
2
3
"""
return iter(self.iterable)
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=6.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "guess-next-dev"
local_scheme = "node-and-timestamp"
write_to = "linq_tool/_version.py"

[project]
name = "linq_tool"
version = "0.1.7"
description = "A tool for LINQ-like operations in Python"
authors = [{ name = "Zozimo Fernandez", email = "zozi.fer96@gmail.com" }]
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.7"

[project.urls]
"Homepage" = "https://github.com/Zozi96/linq_tool"
"Source" = "https://github.com/Zozi96/linq_tool"
"Tracker" = "https://github.com/Zozi96/linq_tool/issues"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
testpaths = ["tests"]

0 comments on commit 20310c5

Please sign in to comment.