sparkleframe 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.
Files changed (53) hide show
  1. sparkleframe-0.0.1/.coverage +13 -0
  2. sparkleframe-0.0.1/.docker/Dockerfile +25 -0
  3. sparkleframe-0.0.1/.docker/docker-compose.yaml +13 -0
  4. sparkleframe-0.0.1/.github/actions/setup-dependencies/action.yml +17 -0
  5. sparkleframe-0.0.1/.github/dependabot.yml +11 -0
  6. sparkleframe-0.0.1/.github/hooks/prepare-commit-msg +18 -0
  7. sparkleframe-0.0.1/.github/workflows/deploy.yml +57 -0
  8. sparkleframe-0.0.1/.github/workflows/predeploy.yml +65 -0
  9. sparkleframe-0.0.1/.github/workflows/verification.yml +54 -0
  10. sparkleframe-0.0.1/.gitignore +174 -0
  11. sparkleframe-0.0.1/.pylintrc +635 -0
  12. sparkleframe-0.0.1/LICENSE +201 -0
  13. sparkleframe-0.0.1/Makefile +69 -0
  14. sparkleframe-0.0.1/PKG-INFO +22 -0
  15. sparkleframe-0.0.1/README.md +6 -0
  16. sparkleframe-0.0.1/changelog.md +9 -0
  17. sparkleframe-0.0.1/pyproject.toml +26 -0
  18. sparkleframe-0.0.1/requirements-dev.in +15 -0
  19. sparkleframe-0.0.1/requirements-dev.txt +170 -0
  20. sparkleframe-0.0.1/requirements-pkg.in +8 -0
  21. sparkleframe-0.0.1/requirements-pkg.txt +46 -0
  22. sparkleframe-0.0.1/scripts/__init__.py +0 -0
  23. sparkleframe-0.0.1/scripts/calculate_version.py +99 -0
  24. sparkleframe-0.0.1/scripts/calculate_version_test.py +76 -0
  25. sparkleframe-0.0.1/scripts/generate_changelog.py +69 -0
  26. sparkleframe-0.0.1/scripts/generate_changelog_test.py +31 -0
  27. sparkleframe-0.0.1/scripts/set_version.py +14 -0
  28. sparkleframe-0.0.1/scripts/utils.py +66 -0
  29. sparkleframe-0.0.1/scripts/utils_test.py +27 -0
  30. sparkleframe-0.0.1/sparkleframe/__init__.py +8 -0
  31. sparkleframe-0.0.1/sparkleframe/activate.py +96 -0
  32. sparkleframe-0.0.1/sparkleframe/base/__init__.py +0 -0
  33. sparkleframe-0.0.1/sparkleframe/base/dataframe.py +20 -0
  34. sparkleframe-0.0.1/sparkleframe/conftest.py +13 -0
  35. sparkleframe-0.0.1/sparkleframe/context.py +86 -0
  36. sparkleframe-0.0.1/sparkleframe/engine.py +16 -0
  37. sparkleframe-0.0.1/sparkleframe/gpt_utils.py +91 -0
  38. sparkleframe-0.0.1/sparkleframe/polarsdf/__init__.py +12 -0
  39. sparkleframe-0.0.1/sparkleframe/polarsdf/column.py +153 -0
  40. sparkleframe-0.0.1/sparkleframe/polarsdf/column_test.py +232 -0
  41. sparkleframe-0.0.1/sparkleframe/polarsdf/dataframe.py +334 -0
  42. sparkleframe-0.0.1/sparkleframe/polarsdf/dataframe_test.py +771 -0
  43. sparkleframe-0.0.1/sparkleframe/polarsdf/functions.py +197 -0
  44. sparkleframe-0.0.1/sparkleframe/polarsdf/functions_test.py +187 -0
  45. sparkleframe-0.0.1/sparkleframe/polarsdf/group.py +38 -0
  46. sparkleframe-0.0.1/sparkleframe/polarsdf/session.py +47 -0
  47. sparkleframe-0.0.1/sparkleframe/polarsdf/session_test.py +37 -0
  48. sparkleframe-0.0.1/sparkleframe/polarsdf/types.py +136 -0
  49. sparkleframe-0.0.1/sparkleframe/tests/__init__.py +0 -0
  50. sparkleframe-0.0.1/sparkleframe/tests/pyspark_test.py +30 -0
  51. sparkleframe-0.0.1/sparkleframe/tests/spark.py +21 -0
  52. sparkleframe-0.0.1/sparkleframe/tests/utils.py +13 -0
  53. sparkleframe-0.0.1/sparkleframe/version.txt +1 -0
@@ -0,0 +1,13 @@
1
+ [run]
2
+ include=
3
+
4
+ omit=
5
+ # put your paths here
6
+ __init__.py
7
+ *_test.py
8
+ sparkleframe/conftest.py
9
+ sparkleframe/activate.py
10
+ sparkleframe/gpt_utils.py
11
+ sparkleframe/tests/spark.py
12
+ sparkleframe/tests/utils.py
13
+ sparkleframe/polarsdf/types.py
@@ -0,0 +1,25 @@
1
+ FROM python:3.11-slim as base
2
+
3
+ # base
4
+ RUN apt-get update && apt-get install -y apt-utils default-jdk curl wget gcc python3-dev gnupg \
5
+ software-properties-common && apt-get clean && rm -rf /var/lib/apt/lists/*
6
+
7
+ # spark
8
+ RUN wget https://archive.apache.org/dist/spark/spark-3.5.4/spark-3.5.4-bin-hadoop3.tgz && \
9
+ tar xf spark-* && \
10
+ mv spark-3.5.4-bin-hadoop3 /opt/spark && \
11
+ rm spark-*.tgz
12
+
13
+ ENV SPARK_HOME "/opt/spark"
14
+ ENV HADOOP_HOME "${SPARK_HOME}"
15
+ ENV PATH "${PATH}:${SPARK_HOME}/bin:${SPARK_HOME}/sbin"
16
+ ENV PYSPARK_PYTHON "/usr/local/bin/python3"
17
+ ENV PYSPARK_DRIVER_PYTHON "${PYSPARK_PYTHON}"
18
+ ENV PYTHONPATH "${PYTHONPATH}:/local:/:"
19
+
20
+ COPY /sparkleframe /sparkleframe
21
+ ENV PYTHONPATH "${PYTHONPATH}:/local:/sparkleframe:/:"
22
+
23
+ # requirements
24
+ COPY requirements-dev.txt .
25
+ RUN pip install -r requirements-dev.txt
@@ -0,0 +1,13 @@
1
+ services:
2
+ sparkleframe:
3
+ build:
4
+ context: ../
5
+ dockerfile: ./.docker/Dockerfile
6
+ container_name: sparkleframe
7
+ environment:
8
+ TIMEZONE: US/Eastern
9
+ volumes:
10
+ - ./../sparkleframe:/sparkleframe
11
+ - ./../.coverage:/sparkleframe/.coverage
12
+ - ./../pyproject.toml:/pyproject.toml
13
+ - ./../.pylintrc:/.pylintrc
@@ -0,0 +1,17 @@
1
+ # Composite action to setup python and install dependencies
2
+ # Useful for use in various pipelines as we usually have to setup python/dependencies
3
+
4
+ name: "Setup Dependencies"
5
+
6
+ runs:
7
+ using: "composite"
8
+ steps:
9
+ - name: Setup Python
10
+ uses: actions/setup-python@v4
11
+ with:
12
+ python-version: '3.11'
13
+ - name: Install backend requirements
14
+ shell: bash
15
+ run: |
16
+ python -m pip install --upgrade pip
17
+ python -m pip install -r requirements-dev.txt
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,18 @@
1
+ #!/bin/bash
2
+
3
+ COMMIT_MSG_FILE="$1"
4
+ COMMIT_SOURCE="$2"
5
+
6
+ # Skip certain commit types (e.g., merge, squash)
7
+ if [[ "$COMMIT_SOURCE" != "merge" && "$COMMIT_SOURCE" != "squash" ]]; then
8
+ BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
9
+
10
+ # Skip if detached HEAD
11
+ if [ "$BRANCH_NAME" != "HEAD" ]; then
12
+ # Read existing message
13
+ COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
14
+
15
+ # Prepend branch name
16
+ echo "#$BRANCH_NAME $COMMIT_MSG" > "$COMMIT_MSG_FILE"
17
+ fi
18
+ fi
@@ -0,0 +1,57 @@
1
+ # Release a new version of SparkleFrame. Changes that take place:
2
+ # -
3
+ # - Documentation is regenerated and a new version added to the docs.
4
+
5
+ name: 'deploy'
6
+
7
+ on:
8
+
9
+ # Allow for manual invocation
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ predeploy:
14
+ uses: ./.github/workflows/predeploy.yml
15
+
16
+ deploy-pypi:
17
+ needs: predeploy
18
+ runs-on: ubuntu-latest
19
+ timeout-minutes: 5
20
+ env:
21
+ FLIT_USERNAME: __token__
22
+ FLIT_INDEX_URL: https://upload.pypi.org/legacy/
23
+
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v3
27
+ - name: Setup Dependencies
28
+ uses: './.github/actions/setup-dependencies'
29
+ - name: Download version file
30
+ uses: actions/download-artifact@v4
31
+ with:
32
+ name: version.txt
33
+ path: sparkleframe
34
+ - name: Store version number
35
+ run: echo "VERSION_NUMBER=$(cat sparkleframe/version.txt)" >> $GITHUB_ENV
36
+ - name: Download changelog
37
+ uses: actions/download-artifact@v4
38
+ with:
39
+ name: changelog.md
40
+ - name: Create new branch
41
+ run: |
42
+ git config --global user.email "flypipe@dummy.com"
43
+ git config --global user.name "flypipe"
44
+ git checkout -b "release/${{ env.VERSION_NUMBER }}"
45
+ git add sparkleframe/version.txt
46
+ git add changelog.md
47
+ git commit -m 'chore: update version file'
48
+ git push origin "release/${{ env.VERSION_NUMBER }}"
49
+ - name: Upload to pypi
50
+ run: |
51
+ flit publish
52
+ env:
53
+ FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
54
+
55
+ # build-docs:
56
+ # needs: deploy-pypi
57
+ # uses: ./.github/workflows/build-docs.yml
@@ -0,0 +1,65 @@
1
+ # Prepare for deployment:
2
+ # - run verification to double check the code quality
3
+ # - calculate the new prospective version
4
+ # - calculate the new prospective changelog
5
+ # By calculating the version/changelog here instead of in the deployment job we can double check these artifacts to
6
+ # ensure they are looking fine prior to releasing.
7
+
8
+ name: 'prepare-for-deployment'
9
+
10
+ on:
11
+ push:
12
+ branches: [ "main" ]
13
+
14
+ # Allow for manual invocation
15
+ workflow_dispatch:
16
+
17
+ # Allow pipeline to be invoked from other pipelines
18
+ workflow_call:
19
+
20
+ jobs:
21
+ verification:
22
+ uses: ./.github/workflows/verification.yml
23
+
24
+ build-wheel:
25
+ needs: verification
26
+ runs-on: ubuntu-latest
27
+ timeout-minutes: 10
28
+
29
+ steps:
30
+ - name: Checkout
31
+ uses: actions/checkout@v3
32
+ with:
33
+ # We need the full history for calculation of the version number
34
+ fetch-depth: 0
35
+ - name: Fetch branches
36
+ run: git fetch
37
+ - name: Setup Dependencies
38
+ uses: './.github/actions/setup-dependencies'
39
+ - name: Calculate new version number
40
+ run: |
41
+ python scripts/calculate_version.py
42
+ echo "VERSION_NUMBER=$(cat ./sparkleframe/version.txt)" >> $GITHUB_ENV
43
+ echo ${{ env.VERSION_NUMBER }}
44
+ - name: Upload version file
45
+ uses: actions/upload-artifact@v4
46
+ with:
47
+ name: version.txt
48
+ path: ./sparkleframe/version.txt
49
+ - name: Calculate changelog for new version
50
+ run: python scripts/generate_changelog.py
51
+ env:
52
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
+ - name: Upload changelog file
54
+ uses: actions/upload-artifact@v4
55
+ with:
56
+ name: changelog.md
57
+ path: ./changelog.md
58
+ # Build and upload the wheel so we can access the wheel without having to upload it to pypi
59
+ - name: Build wheel
60
+ run: flit build --no-use-vcs
61
+ - name: Upload wheel
62
+ uses: actions/upload-artifact@v4
63
+ with:
64
+ name: sparkleframe-${{ env.VERSION_NUMBER }}-py3-none-any.whl
65
+ path: ./dist/sparkleframe-${{ env.VERSION_NUMBER }}-py3-none-any.whl
@@ -0,0 +1,54 @@
1
+ name: verification
2
+
3
+ # Controls when the workflow will run
4
+ on:
5
+ # Triggers the workflow on push or pull request events but only for the "main" branch
6
+ push:
7
+ branches: [ "main" ]
8
+ pull_request:
9
+ branches: [ "**" ]
10
+
11
+ # Allows you to run this workflow manually from the Actions tab
12
+ workflow_dispatch:
13
+
14
+ # Allow pipeline to be invoked from other pipelines
15
+ workflow_call:
16
+
17
+ jobs:
18
+ build:
19
+ # The type of runner that the job will run on
20
+ runs-on: ubuntu-latest
21
+ timeout-minutes: 30
22
+
23
+ # Steps represent a sequence of tasks that will be executed as part of the job
24
+ steps:
25
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26
+ - name: Checkout
27
+ uses: actions/checkout@v3
28
+ with:
29
+ # Fetch all tags/branches to run diff-cover properly
30
+ fetch-depth: 0
31
+ - name: Setup docker compose
32
+ run: |
33
+ curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
34
+ chmod +x /usr/local/bin/docker-compose
35
+ docker-compose version
36
+ - name: Setup dependencies
37
+ uses: ./.github/actions/setup-dependencies
38
+ - name: Run unit tests for scripts (calculate wheel version and changelogs)
39
+ run: pytest scripts/*_test.py
40
+ env:
41
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42
+ - name: Package version number (preview)
43
+ run: |
44
+ python scripts/calculate_version.py
45
+ - name: Changelog (preview)
46
+ run: python scripts/generate_changelog.py
47
+ env:
48
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
+ - name: Run formatter on backend (black)
50
+ run: make black-check
51
+ - name: Run linter (ruff)
52
+ run: make lint
53
+ - name: Run unit tests
54
+ run: make coverage
@@ -0,0 +1,174 @@
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
+ /sparkleframe/.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
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc