onecode 1.1.0__tar.gz → 1.2.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 (49) hide show
  1. {onecode-1.1.0 → onecode-1.2.1}/PKG-INFO +7 -5
  2. {onecode-1.1.0 → onecode-1.2.1}/onecode/__init__.py +1 -1
  3. {onecode-1.1.0 → onecode-1.2.1}/onecode/base/enums.py +3 -0
  4. {onecode-1.1.0 → onecode-1.2.1}/onecode/base/logger.py +4 -1
  5. {onecode-1.1.0 → onecode-1.2.1}/onecode/base/project.py +2 -1
  6. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/utils.py +1 -2
  7. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/zip.py +6 -0
  8. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/csv_reader.py +1 -1
  9. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input_element.py +1 -1
  10. {onecode-1.1.0 → onecode-1.2.1}/pyproject.toml +3 -4
  11. {onecode-1.1.0 → onecode-1.2.1}/LICENSE +0 -0
  12. {onecode-1.1.0 → onecode-1.2.1}/README.md +0 -0
  13. {onecode-1.1.0 → onecode-1.2.1}/onecode/base/__init__.py +0 -0
  14. {onecode-1.1.0 → onecode-1.2.1}/onecode/base/decorator.py +0 -0
  15. {onecode-1.1.0 → onecode-1.2.1}/onecode/base/singleton.py +0 -0
  16. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/__init__.py +0 -0
  17. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/add.py +0 -0
  18. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/build.py +0 -0
  19. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/check.py +0 -0
  20. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/create.py +0 -0
  21. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/extract.py +0 -0
  22. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/require.py +0 -0
  23. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/skeleton/.gitignore +0 -0
  24. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/skeleton/LICENSE +0 -0
  25. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/skeleton/README.md +0 -0
  26. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/skeleton/data/README.md +0 -0
  27. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/skeleton/flows/README.md +0 -0
  28. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/skeleton/main.py +0 -0
  29. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/skeleton/requirements.txt +0 -0
  30. {onecode-1.1.0 → onecode-1.2.1}/onecode/cli/start.py +0 -0
  31. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/__init__.py +0 -0
  32. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/__init__.py +0 -0
  33. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/__init__.pyi +0 -0
  34. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/checkbox.py +0 -0
  35. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/dropdown.py +0 -0
  36. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/file_input.py +0 -0
  37. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/number_input.py +0 -0
  38. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/radio_button.py +0 -0
  39. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/slider.py +0 -0
  40. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/input/text_input.py +0 -0
  41. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/output/__init__.py +0 -0
  42. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/output/__init__.pyi +0 -0
  43. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/output/file_output.py +0 -0
  44. {onecode-1.1.0 → onecode-1.2.1}/onecode/elements/output_element.py +0 -0
  45. {onecode-1.1.0 → onecode-1.2.1}/onecode/utils/__init__.py +0 -0
  46. {onecode-1.1.0 → onecode-1.2.1}/onecode/utils/import_input.py +0 -0
  47. {onecode-1.1.0 → onecode-1.2.1}/onecode/utils/import_output.py +0 -0
  48. {onecode-1.1.0 → onecode-1.2.1}/onecode/utils/module.py +0 -0
  49. {onecode-1.1.0 → onecode-1.2.1}/onecode/utils/typing.py +0 -0
@@ -1,12 +1,13 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: onecode
3
- Version: 1.1.0
3
+ Version: 1.2.1
4
4
  Summary: Python skeleton and library for OneCode projects
5
5
  License: MIT
6
+ License-File: LICENSE
6
7
  Keywords: onecode,share,deploy,cloud
7
8
  Author: DeepLime
8
9
  Author-email: contact@deeplime.io
9
- Requires-Python: >=3.8,<3.13
10
+ Requires-Python: >=3.8,<3.15
10
11
  Classifier: Development Status :: 5 - Production/Stable
11
12
  Classifier: Intended Audience :: Developers
12
13
  Classifier: Intended Audience :: End Users/Desktop
@@ -21,11 +22,12 @@ Classifier: Programming Language :: Python :: 3.9
21
22
  Classifier: Programming Language :: Python :: 3.10
22
23
  Classifier: Programming Language :: Python :: 3.11
23
24
  Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: 3.14
24
27
  Classifier: Topic :: Scientific/Engineering
25
28
  Classifier: Topic :: Software Development :: Code Generators
26
29
  Provides-Extra: developer
27
30
  Provides-Extra: docs
28
- Requires-Dist: astunparse (>=1.6.3,<2)
29
31
  Requires-Dist: datatest (>=0.11.1,<1) ; extra == "developer"
30
32
  Requires-Dist: flufl.lock (>=7.1.1,<9)
31
33
  Requires-Dist: griffe (>=0,<1) ; extra == "docs"
@@ -35,7 +37,7 @@ Requires-Dist: mkdocs (>=1.5,<2.0) ; extra == "docs"
35
37
  Requires-Dist: mkdocs-material (>=9.5,<10.0) ; extra == "docs"
36
38
  Requires-Dist: mkdocstrings (>=0,<1) ; extra == "docs"
37
39
  Requires-Dist: mkdocstrings-python (>=1,<2) ; extra == "docs"
38
- Requires-Dist: onecode-pycg (>=0.0.7,<1)
40
+ Requires-Dist: onecode-pycg (>=0.0.7,<2)
39
41
  Requires-Dist: pandas (>=1.4.0,<3)
40
42
  Requires-Dist: pydantic (>=2,<3) ; extra == "developer"
41
43
  Requires-Dist: pydash (>=5.1.0,<8)
@@ -1,7 +1,7 @@
1
1
  # SPDX-FileCopyrightText: 2023-2024 DeepLime <contact@deeplime.io>
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
- __version__ = "1.1.0"
4
+ __version__ = "1.2.1"
5
5
 
6
6
 
7
7
  from .base import *
@@ -35,12 +35,15 @@ class ConfigOption(StrEnum):
35
35
  - `LOGGER_TIMESTAMP`: to timestamp the logs :octicons-arrow-both-24: `"LOGGER_TIMESTAMP": True`
36
36
  - `CHECK_MODULES`: to check modules in requirements.txt are present in the current environment
37
37
  when starting the OneCode application :octicons-arrow-both-24: `"CHECK_MODULES": True`
38
+ - `CLOUD_ENV`: used by OneCode Cloud to identify cloud env
39
+ typically to handle code using display :octicons-arrow-both-24: `"CLOUD_ENV": False`
38
40
 
39
41
  """
40
42
  FLUSH_STDOUT = "FLUSH_STDOUT" # noqa: E-221
41
43
  LOGGER_COLOR = "LOGGER_COLOR" # noqa: E-221
42
44
  LOGGER_TIMESTAMP = "LOGGER_TIMESTAMP" # noqa: E-221
43
45
  CHECK_MODULES = "CHECK_MODULES" # noqa: E-221
46
+ CLOUD_ENV = "CLOUD_ENV" # noqa: E-221
44
47
 
45
48
 
46
49
  class Mode(StrEnum):
@@ -144,7 +144,10 @@ class Logger(metaclass=Singleton):
144
144
 
145
145
  handler = logging.StreamHandler(sys.stdout)
146
146
  handler.setFormatter(ColoredFormatter(Project().get_config(ConfigOption.LOGGER_COLOR)))
147
- logging.getLogger(Env.ONECODE_LOGGER_NAME).addHandler(handler)
147
+
148
+ base_logger = logging.getLogger(Env.ONECODE_LOGGER_NAME)
149
+ base_logger.addHandler(handler)
150
+ base_logger.propagate = False
148
151
  self.set_level(logging.INFO)
149
152
 
150
153
  @check_type
@@ -88,7 +88,8 @@ class Project(metaclass=Singleton):
88
88
  ConfigOption.FLUSH_STDOUT: False,
89
89
  ConfigOption.LOGGER_COLOR: True,
90
90
  ConfigOption.LOGGER_TIMESTAMP: True,
91
- ConfigOption.CHECK_MODULES: True,
91
+ ConfigOption.CHECK_MODULES: False,
92
+ ConfigOption.CLOUD_ENV: False,
92
93
  **{k[len("ONECODE_CONFIG_"):]: os.environ[k]
93
94
  for k in os.environ if k.startswith("ONECODE_CONFIG_")},
94
95
  **{k[len("ONECODE_FLAG_"):]: bool(ast.literal_eval(os.environ[k]))
@@ -9,7 +9,6 @@ from glob import iglob
9
9
  from typing import Dict, List, Optional
10
10
 
11
11
  import pydash
12
- from astunparse import unparse
13
12
  from InquirerPy.base.control import Choice
14
13
  from pycg.pycg import CallGraphGenerator
15
14
  from pycg.utils.constants import CALL_GRAPH_OP
@@ -178,7 +177,7 @@ def extract_calls(
178
177
  code.body[0].value.func = ast.parse(fn['normed'])
179
178
  calls.append({
180
179
  "func": fn['normed'],
181
- "loc": unparse(code).strip()
180
+ "loc": ast.unparse(code).strip()
182
181
  })
183
182
  else:
184
183
  if verbose:
@@ -31,6 +31,7 @@ def zip_output(
31
31
  """
32
32
 
33
33
  compression = zipfile.ZIP_STORED if compression_level == 0 else zipfile.ZIP_DEFLATED
34
+ files_in_archive = set()
34
35
  with zipfile.ZipFile(
35
36
  to_file,
36
37
  "w",
@@ -52,6 +53,11 @@ def zip_output(
52
53
  os.path.relpath(output_file, os.path.join(data_path, "outputs"))
53
54
  )
54
55
 
56
+ if arcpath in files_in_archive: # pragma: no cover
57
+ continue
58
+
59
+ files_in_archive.add(arcpath)
60
+
55
61
  if verbose:
56
62
  print(f"Archiving {output['key']}: {output_file} => {arcpath}")
57
63
 
@@ -61,7 +61,7 @@ class CsvReader(InputElement):
61
61
  value="/path/to/file.csv",
62
62
  label="My CSV Reader",
63
63
  tags=['CSV'],
64
- delimiter=","
64
+ sep=","
65
65
  )
66
66
 
67
67
  pd.testing.assert_frame_equal(widget, pd.read_csv("/path/to/file.csv"))
@@ -193,7 +193,7 @@ class InputElement(ABC):
193
193
  The element disabling condition.
194
194
 
195
195
  """
196
- return self._disabled
196
+ return self._disabled if isinstance(self._disabled, str) else False
197
197
 
198
198
  @property
199
199
  def hide_when_disabled(self) -> bool:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "onecode"
3
- version = "1.1.0"
3
+ version = "1.2.1"
4
4
  description = "Python skeleton and library for OneCode projects"
5
5
  readme = "README.md"
6
6
  authors = ["DeepLime <contact@deeplime.io>"]
@@ -23,7 +23,7 @@ classifiers = [
23
23
  ]
24
24
 
25
25
  [tool.poetry.dependencies]
26
- python = ">=3.8, <3.13"
26
+ python = ">=3.8, <3.15"
27
27
  'flufl.lock' = ">=7.1.1,<9"
28
28
  pandas = ">=1.4.0,<3"
29
29
  pydash = ">=5.1.0,<8"
@@ -33,9 +33,8 @@ typeguard = ">=3,<5"
33
33
  requirements-parser = ">=0.10.2,<1"
34
34
 
35
35
  # cli
36
- astunparse = ">=1.6.3,<2"
37
36
  inquirerpy = ">=0.3.3,<1"
38
- onecode-pycg = ">=0.0.7,<1"
37
+ onecode-pycg = ">=0.0.7,<2"
39
38
  yaspin = ">=2.1.0,<4"
40
39
 
41
40
  # docs
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes