diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ea06c39..ed069c9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "fable": { - "version": "4.0.0-snake-island-alpha-006", + "version": "4.0.0-snake-island-alpha-014", "commands": [ "fable" ] diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 53ae3ef..9484014 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -12,23 +12,40 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.100 + - name: Setup dotnet tools run: dotnet tool restore + - name: Install src dependencies run: dotnet restore src + - name: Install test dependencies run: dotnet restore test + - name: Install pytest runner run: pip install pytest + - name: Install build dependencies run: dotnet restore Build.fsproj + #- name: Check formatting # run: dotnet fantomas . -r --check + - name: Build run: dotnet run Build --configuration Release --no-restore + + - name: Install dependencies + run: | + pip install poetry + poetry install + - name: Test run: dotnet run Test diff --git a/Build.fs b/Build.fs index a1b253f..e48e6c7 100644 --- a/Build.fs +++ b/Build.fs @@ -34,7 +34,7 @@ Target.create "Test" (fun _ -> "python", dotnet $"fable --lang Python --outDir {buildPath}/tests" testsPath ] |> runParallel - run pytest $"{buildPath}/tests" "" + run poetry $"run pytest {buildPath}/tests" "" ) Target.create "Pack" (fun _ -> diff --git a/Helpers.fs b/Helpers.fs index 8600ec5..5ef320e 100644 --- a/Helpers.fs +++ b/Helpers.fs @@ -75,6 +75,7 @@ let dotnet = createProcess "dotnet" let pytest = createProcess "pytest" +let poetry = createProcess "poetry" let npm = let npmPath = diff --git a/README.md b/README.md index 3eb7b7b..011c8b8 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ how to deal with Python version handling. Prerequisite for compiling F# to Python using Fable: ```sh -> dotnet tool install --global fable --version 4.0.0-snake-island-alpha-006 -> dotnet add package Fable.Core --version 4.0.0-snake-island-alpha-006 +> dotnet tool install --global fable --version 4.0.0-snake-island-alpha-014 +> dotnet add package Fable.Core --version 4.0.0-snake-island-alpha-007 ``` To use the `Fable.Python` library in your Fable project: diff --git a/examples/README.md b/examples/README.md index 21fca19..c92b776 100644 --- a/examples/README.md +++ b/examples/README.md @@ -13,4 +13,4 @@ instead. - Timeflies, use Fable Python with Tkinter and AsyncRx NOTE: If you make demos or examples with Fable Python then please -consider providing a PR so we can add it here. \ No newline at end of file +consider providing a PR so we can add it here. diff --git a/examples/timeflies/TimeFlies.fsproj b/examples/timeflies/TimeFlies.fsproj index 624575f..4a6f9c6 100644 --- a/examples/timeflies/TimeFlies.fsproj +++ b/examples/timeflies/TimeFlies.fsproj @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/paket.dependencies b/paket.dependencies index 5ac92c4..07d7d61 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -5,7 +5,7 @@ storage: none framework: net6.0, netstandard2.0, netstandard2.1 nuget FSharp.Core ~> 4.7 -nuget Fable.Core >= 4.0.0-snake-island-alpha-006 +nuget Fable.Core >= 4.0.0-snake-island-alpha-007 group Test source https://api.nuget.org/v3/index.json @@ -13,7 +13,7 @@ group Test framework: net6.0 nuget FSharp.Core - nuget Fable.Core >= 4.0.0-snake-island-alpha-006 + nuget Fable.Core >= 4.0.0-snake-island-alpha-007 nuget Microsoft.NET.Test.Sdk ~> 16 nuget XUnit ~> 2 nuget xunit.runner.visualstudio ~> 2 diff --git a/paket.lock b/paket.lock index e49412d..72a31d4 100644 --- a/paket.lock +++ b/paket.lock @@ -2,7 +2,7 @@ STORAGE: NONE RESTRICTION: || (== net6.0) (== netstandard2.0) (== netstandard2.1) NUGET remote: https://api.nuget.org/v3/index.json - Fable.Core (4.0.0-snake-island-alpha-006) + Fable.Core (4.0.0-snake-island-alpha-007) FSharp.Core (4.7.2) GROUP Build @@ -63,7 +63,7 @@ STORAGE: NONE RESTRICTION: == net6.0 NUGET remote: https://api.nuget.org/v3/index.json - Fable.Core (4.0.0-snake-island-alpha-006) + Fable.Core (4.0.0-snake-island-alpha-007) FSharp.Core (6.0.5) Microsoft.CodeCoverage (17.2) Microsoft.NET.Test.Sdk (16.11) diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..e4c7ad2 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,163 @@ +[[package]] +name = "atomicwrites" +version = "1.4.1" +description = "Atomic file writes." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "attrs" +version = "21.4.0" +description = "Classes Without Boilerplate" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.extras] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] +docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"] + +[[package]] +name = "colorama" +version = "0.4.5" +description = "Cross-platform colored terminal text." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "fable-library" +version = "0.8.0" +description = "Fable library for Python" +category = "main" +optional = false +python-versions = ">= 3.9, < 4.0" +develop = true + +[package.source] +type = "directory" +url = "build/fable_modules/fable-library" + +[[package]] +name = "iniconfig" +version = "1.1.1" +description = "iniconfig: brain-dead simple config-ini parsing" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "packaging" +version = "21.3" +description = "Core utilities for Python packages" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" + +[[package]] +name = "pluggy" +version = "1.0.0" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "py" +version = "1.11.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "pyparsing" +version = "3.0.9" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" +category = "dev" +optional = false +python-versions = ">=3.6.8" + +[package.extras] +diagrams = ["railroad-diagrams", "jinja2"] + +[[package]] +name = "pytest" +version = "6.2.5" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +py = ">=1.8.2" +toml = "*" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[metadata] +lock-version = "1.1" +python-versions = ">= 3.9, < 4.0" +content-hash = "62fed915dffc4a50bd630ea2c9e7378ce18497742eeecbaa8fb81a198ee8b665" + +[metadata.files] +atomicwrites = [] +attrs = [ + {file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"}, + {file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"}, +] +colorama = [ + {file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, + {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, +] +fable-library = [] +iniconfig = [ + {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, + {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, +] +packaging = [ + {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, + {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, +] +pluggy = [ + {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, + {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, +] +py = [ + {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, + {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, +] +pyparsing = [ + {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, + {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, +] +pytest = [] +toml = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..266c11b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[tool.poetry] +name = "Fable Python" +version = "4.0.0" +description = "Fable" +authors = ["Dag Brattli "] +license = "MIT License" +readme = "README.md" +homepage = "https://fable.io" + +[tool.poetry.dependencies] +python = ">= 3.9, < 4.0" +fable-library = "" + +[tool.poetry.dev-dependencies] +fable-library = {path = "./build/fable_modules/fable-library", develop = true} +pytest = "^6.2.4" + +[tool.pyright] +reportMissingTypeStubs = false +reportMissingImports = false +reportUnnecessaryTypeIgnoreComment = true +reportUnusedImport = true +reportUnusedVariable = true +reportUnnecessaryIsInstance = true +reportUnnecessaryComparison = true +reportUnnecessaryCast = true +reportPrivateUsage = true +reportImportCycles = true +reportDuplicateImport = true +reportConstantRedefinition = true +reportOverlappingOverload = true +reportInconsistentConstructor = true +reportImplicitStringConcatenation = true +pythonVersion = "3.10" +typeCheckingMode = "basic" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api"