Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add config for PyPI runtime publishing #5273

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Source/DafnyRuntime/DafnyRuntimePython/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
### from https://github.com/github/gitignore/blob/main/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Environments
.env
venv/
20 changes: 19 additions & 1 deletion Source/DafnyRuntime/DafnyRuntimePython/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
DAFNY = dotnet run --project ../../Dafny --no-build --

GENERATED_SYSTEM_MODULE_SOURCE=../obj/systemModulePopulator-py/System_.py
GENERATED_SYSTEM_MODULE_TARGET=System_.py
GENERATED_SYSTEM_MODULE_TARGET=System_/__init__.py

VIRTUALENV = venv

all: check-system-module

Expand All @@ -15,3 +17,19 @@ check-system-module: build-system-module

update-system-module: build-system-module
cp $(GENERATED_SYSTEM_MODULE_SOURCE) $(GENERATED_SYSTEM_MODULE_TARGET)

setup-venv:
python -m venv --clear $(VIRTUALENV)
$(VIRTUALENV)/bin/pip install --upgrade build twine

clean-package:
rm -rf dist/

build-package:
$(VIRTUALENV)/bin/python -m build

upload-package-testpypi:
$(VIRTUALENV)/bin/python -m twine upload --repository testpypi dist/*

upload-package-pypi:
$(VIRTUALENV)/bin/python -m twine upload dist/*
21 changes: 21 additions & 0 deletions Source/DafnyRuntime/DafnyRuntimePython/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "DafnyRuntimePython"
version = "4.7.0"
authors = [
{ name = "The Dafny core team", email = "[email protected]" },
]
description = "Dafny runtime for Python"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/dafny-lang/dafny"
Issues = "https://github.com/dafny-lang/dafny/issues"
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ hello, Dafny
Dafny program verifier finished with 0 verified, 0 errors
Wrote textual form of target program to CompileAndThenRun-py/__main__.py
Additional output written to CompileAndThenRun-py/CompileAndThenRun-py.dtr
Additional output written to CompileAndThenRun-py/System_.py
Additional output written to CompileAndThenRun-py/_dafny.py
Additional output written to CompileAndThenRun-py/System_/__init__.py
Additional output written to CompileAndThenRun-py/_dafny/__init__.py
Additional output written to CompileAndThenRun-py/module_.py
hello, Dafny
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ hello, Dafny
Dafny program verifier finished with 0 verified, 0 errors
Wrote textual form of target program to JustRun-py/__main__.py
Additional output written to JustRun-py/JustRun-py.dtr
Additional output written to JustRun-py/System_.py
Additional output written to JustRun-py/_dafny.py
Additional output written to JustRun-py/System_/__init__.py
Additional output written to JustRun-py/_dafny/__init__.py
Additional output written to JustRun-py/module_.py
Running...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ hello, Dafny
Dafny program verifier finished with 0 verified, 0 errors
Wrote textual form of target program to ManualCompile-py/__main__.py
Additional output written to ManualCompile-py/ManualCompile-py.dtr
Additional output written to ManualCompile-py/System_.py
Additional output written to ManualCompile-py/_dafny.py
Additional output written to ManualCompile-py/System_/__init__.py
Additional output written to ManualCompile-py/_dafny/__init__.py
Additional output written to ManualCompile-py/module_.py
hello, Dafny