Skip to content

Commit f161ddb

Browse files
authored
Use pyproject.toml (#71)
* Use pyproject.toml * copyright
1 parent 0c37fc8 commit f161ddb

File tree

14 files changed

+85
-200
lines changed

14 files changed

+85
-200
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ jobs:
9696
- name: Test with pytest
9797
run: |
9898
python -c "import sys; print(sys.version, '\n', sys.prefix)";
99-
pytest -v --cov pscript --cov-config=.coveragerc --cov-report=term --cov-report=html tests
99+
pytest -v --cov pscript --cov-report=term --cov-report=html tests

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2020, PScript developers
1+
Copyright (c) 2015-2025, Almar Klein
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

MANIFEST.in

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ also be useful by itself.
1515
Installation
1616
------------
1717

18-
PScript is pure Python and requires Python 2.7 or 3.5+ (including Pypy).
18+
PScript is pure Python and requires Python 3.6+ (including Pypy).
1919
It has no further dependencies.
2020

2121
* ``pip install pscript``, or

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
# General information about the project.
6161
project = 'PScript'
62-
copyright = '2015-2020, PScript contributors'
62+
copyright = '2015-2025, Almar Klein'
6363

6464
# The version info for the project you're documenting, acts as replacement for
6565
# |version| and |release|, also used in various other places throughout the

docs/gettingstarted.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Getting started
44
Installation
55
------------
66

7-
PScript has no dependencies except Python. It requires Python 2.7 or 3.4+.
7+
PScript has no dependencies except Python. It requires Python 3.6+.
88
Use either of these to install PScript:
9-
9+
1010
* ``pip install pscript``
1111
* ``conda install pscript``
1212

@@ -21,16 +21,16 @@ A short example:
2121
.. code-block:: py
2222
2323
from pscript import py2js
24-
24+
2525
def foo(a, b=2):
2626
print(a - b)
27-
27+
2828
print(py2js(foo))
2929
3030
Gives:
3131

3232
.. code-block:: js
33-
33+
3434
var foo;
3535
foo = function flx_foo (a, b) {
3636
b = (b === undefined) ? 2: b;

pscript/testing.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
# Copyright (c) 2016, Almar Klein
3-
# Distributed under the (new) BSD License.
4-
51
"""
62
Functionality used for testing, based on pytest. This module is designed
73
to just work, without modification, in most projects.
@@ -16,9 +12,6 @@
1612
and report coverage. Magic!
1713
"""
1814

19-
20-
from __future__ import absolute_import, print_function, division
21-
2215
import os
2316
import sys
2417
import inspect
@@ -50,7 +43,7 @@
5043

5144
def run_tests_if_main(show_coverage=False):
5245
""" Run tests in a given file if it is run as a script
53-
46+
5447
Coverage is reported for running this single test. Set show_coverage to
5548
launch the report in the web browser.
5649
"""

pyproject.toml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Notes on how to do a release.
2+
#
3+
# * Write release notes in docs/releasenotes.txt
4+
# * Bump `__version__` and commit.
5+
# * git tag vx.y
6+
# * git push origin main vx.y
7+
# * flit publish
8+
9+
# ===== Project info
10+
11+
[project]
12+
dynamic = ["version"]
13+
name = "pscript"
14+
description = "Python to JavaScript compiler."
15+
readme = "README.md"
16+
license = { file = "LICENSE" }
17+
authors = [{ name = "Almar Klein" }]
18+
keywords = ["Python", "JavaScript", "compiler", "transpiler", "parser"]
19+
requires-python = ">= 3.6"
20+
dependencies = []
21+
[project.optional-dependencies]
22+
lint = ["ruff"]
23+
tests = ["pytest"]
24+
docs = ["sphinx"]
25+
dev = ["pscript[lint,tests, docs]"]
26+
27+
[project.urls]
28+
Homepage = "https://github.com/flexxui/pscript"
29+
Documentation = "http://pscript.readthedocs.io"
30+
Repository = "https://github.com/flexxui/pscript"
31+
32+
33+
# ===== Building
34+
35+
# Flit is great solution for simple pure-Python projects.
36+
[build-system]
37+
requires = ["flit_core >=3.2,<4"]
38+
build-backend = "flit_core.buildapi"
39+
40+
41+
# ===== Tooling
42+
43+
[tool.ruff]
44+
line-length = 88
45+
46+
[tool.ruff.lint]
47+
select = ["F", "E", "W", "B", "RUF"]
48+
ignore = [
49+
# "RUF005", # Consider iterable unpacking instead of concatenation
50+
]
51+
52+
53+
[tool.coverage.report]
54+
55+
exclude_also = [
56+
# Have to re-enable the standard pragma, plus a less-ugly flavor
57+
"pragma: no cover",
58+
"no-cover",
59+
"raise NotImplementedError",
60+
"raise AssertionError",
61+
"raise JSError",
62+
# Don't complain if non-runnable code isn't run:
63+
"if 0:",
64+
"if False:",
65+
"if __name__ == .__main__.:",
66+
"if this_is_js():",
67+
68+
# Don't complain for platform specific code
69+
"sys\\.platform.startswith\\(\\'win\\'\\)",
70+
"sys\\.platform.startswith\\(\\'darwin\\'\\)",
71+
"getattr\\(sys, \\'frozen\\'\\,\\ None\\)",
72+
73+
# Don't complain about caught import fails
74+
"except ImportError:",
75+
]

setup.cfg

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)