Skip to content

Commit

Permalink
Merge pull request #60 from dkedar7/dev
Browse files Browse the repository at this point in the history
Upgrade Poetry, fix Ubuntu test errors
  • Loading branch information
dkedar7 authored Feb 17, 2025
2 parents b0f9628 + 0aeac48 commit 921d13a
Show file tree
Hide file tree
Showing 8 changed files with 4,876 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# The type of runner that the job will run on
strategy:
matrix:
python-versions: [3.8, 3.9, '3.10', '3.11']
python-versions: [3.9, '3.10', '3.11', '3.12', '3.13']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
poetry build
- name: publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN}}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,4 @@ site/
# Compressed files
*.zip
examples/Simple text to text/.dockerignore
.pypirc
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.md.
3. The pull request should work for Python 3.8, 3.9, 3.10, 3.11 and for PyPy. Check
3. The pull request should work for Python 3.9, 3.10, 3.11. 3.12, 3.13 and for PyPy. Check
https://github.com/dkedar7/fast_dash/actions
and make sure that the tests pass for all supported Python versions.

Expand Down
9 changes: 8 additions & 1 deletion fast_dash/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,14 @@ def _clean_text(string):


def _infer_variable_names(func):
s = inspect.getsource(func)

try:
s = inspect.getsource(func)

except OSError:
import dill.source
s = dill.source.getsource(func)

final_line = s.split("return")[-1].strip()
line_without_comment = final_line.split("#")[0].strip().split(",")

Expand Down
4,816 changes: 4,816 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

62 changes: 33 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,53 +1,59 @@
[tool]
[tool.poetry]
[project]
name = "fast_dash"
version = "0.2.9"
homepage = "https://github.com/dkedar7/fast_dash"
documentation = "https://docs.fastdash.app"
description = "Turn your Python functions into interactive web applications. Fast Dash is an innovative way to build and deploy your Python code as interactive apps with minimal changes to your original code."
authors = ["Kedar Dabhadkar <kedar@fastdash.app>"]
keywords = ["webdevelopment", "python", "machine-learning", "data-science", "data-visualization", "dash"]
authors = [
{name = "Kedar Dabhadkar", email = "<kedar@fastdash.app>"}
]
readme = "README.md"
license = "MIT"
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11'
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13'
]

requires-python = ">=3.9,<3.14"

packages = [
{ include = "fast_dash" },
{ include = "tests", format = "sdist" },
]

[tool.poetry.dependencies]
python = ">=3.8,<3.12"

Flask = "^2.0.2"
plotly = "^5.5.0"
dash-bootstrap-components = "^1.0.2"
Pillow = "^9.2.0"
dash-mantine-components = "^0.12.1"
numpy = "<=1.25.0"
dash-iconify = "^0.1.2"
matplotlib = "<=3.7.1"
pandas = "<2.1.1"
docstring-parser = "^0.15"
dash = ">=2.11.0"
dependencies = [
"dash>=2.11.0",
"pandas>=1.0.0",
"dash-bootstrap-components>=1.0.2",
"dash-mantine-components>=0.12.1,<0.13",
"dash-iconify>=0.1.2",
"Pillow>=9.2.0",
"matplotlib>=3.5.0",
"docstring-parser>=0.15",
"dill (>=0.3.9,<0.4.0)",
"pyreadline3 (>=3.5.4,<4.0.0)",
]

[tool.poetry.extras]
[project.optional-dependencies]
test = [
"pytest",
"black",
"isort",
"flake8",
"flake8-docstrings",
"pytest-cov",
"selenium",
"dash"
"selenium"
]

dev = ["tox", "pre-commit", "virtualenv", "twine", "toml"]
Expand All @@ -59,7 +65,6 @@ doc = [
"mkdocs-material",
"mkdocstrings-python",
"griffe",
"mkdocs-material-extension",
"mkdocs-autorefs",
"mkdocs-jupyter"
]
Expand All @@ -74,7 +79,7 @@ pytest-cov = "^3.0.0"
tox = "^3.25.1"
pre-commit = "^2.20.0"
virtualenv = "^20.16.3"
twine = "^4.0.1"
twine = "*"
toml = "^0.10.2"
mkdocs = "^1.3.1"
livereload = "^2.6.3"
Expand All @@ -84,16 +89,15 @@ mkdocs-autorefs = "^0.4.1"
mkdocstrings-python = "^0.7.1"
mkdocs-jupyter = "^0.24.1"
griffe = "<0.31.0"
docutils = "!=0.21"
docutils = ">0.21"

[tool.poetry.group.test.dependencies]
urllib3 = "1.26.15"
dash = {version = ">=2.11.0", extras = ["testing"]}
selenium = "<=4.2.0"

urllib3 = "*"
dash = {version = ">2.11.0", extras = ["testing"]}
selenium = "<4.2.0"

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

[tool.black]
Expand Down
14 changes: 12 additions & 2 deletions tests/test_fast_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
import time

import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException



## Define callback functions
def simple_text_to_text_function(input_text):
"Converts text to text"
Expand Down Expand Up @@ -94,7 +98,10 @@ def test_fdfd004_click_submit(dash_duo):
dash_duo.wait_for_text_to_equal("#output-1", "Sample text", timeout=4)

# Click clear
dash_duo.multiple_click("#reset_inputs", 1)
wait = WebDriverWait(dash_duo.driver, 10)
reset_button = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "#reset_inputs")))
dash_duo.driver.execute_script("document.querySelector('#reset_inputs').click()")

dash_duo.wait_for_text_to_equal("#output-1", "", timeout=4)


Expand All @@ -121,7 +128,10 @@ def test_fdfd005_multiple_outputs(dash_duo):
dash_duo.wait_for_text_to_equal("#output-2", "Sample text", timeout=4)

# Click clear
dash_duo.multiple_click("#reset_inputs", 1)
# Click clear
wait = WebDriverWait(dash_duo.driver, 10)
reset_button = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "#reset_inputs")))
dash_duo.driver.execute_script("document.querySelector('#reset_inputs').click()")
dash_duo.wait_for_text_to_equal("#output-1", "", timeout=4)
dash_duo.wait_for_text_to_equal("#output-2", "", timeout=4)

Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[tox]
isolated_build = true
envlist = py38, py39, py310, lint, format
envlist = py38, py39, py310, py311, py312, py313, lint, format

[gh-actions]
python =
3.13: py313
3.12: py312
3.11: py311
3.10: py310
3.9: py39
3.8: py38

[testenv:lint]
allowlist_externals =
Expand Down

0 comments on commit 921d13a

Please sign in to comment.