Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3f17c02
ci tweaks: platform and build config changes
mbdevpl Nov 21, 2019
ecee573
test on 3.8
mbdevpl Nov 21, 2019
ea5ba1b
require more specific version of pcpp
mbdevpl Nov 27, 2019
5700930
tmp [skip appveyor]
mbdevpl Nov 28, 2019
fe3bff9
more concrete requirements
mbdevpl Feb 5, 2020
96f5589
travis.org -> .com
mbdevpl Feb 5, 2020
c1788b3
chore: housekeeping
mbdevpl Feb 15, 2025
d5d562a
build: add github actions and dependabot
mbdevpl Feb 15, 2025
74f18c6
chore: rename core requirements files
mbdevpl Feb 15, 2025
aa2a399
chore: update requirements filename references
mbdevpl Feb 15, 2025
a6a74b1
fix: remove deprecated type
mbdevpl Feb 15, 2025
56702d9
refactor: migrate extras requirements json to txt
mbdevpl Feb 15, 2025
1a49605
fix: bump C dependencies
mbdevpl Feb 15, 2025
9715561
fix: typo
mbdevpl Feb 15, 2025
ddc6104
test(c): skip tests is dependencies missing
mbdevpl Feb 15, 2025
d50105e
test: isolate tools for C tests
mbdevpl Feb 15, 2025
674334e
feat: add general class for interacting with external tools
mbdevpl Feb 15, 2025
2673e1f
test(fortran): tests run only if should be
mbdevpl Feb 16, 2025
f7fcb8f
test: remove unsupported tests
mbdevpl Feb 16, 2025
fa667e5
test(fortran): isolate further
mbdevpl Feb 16, 2025
c21a2cc
chore: update copyright notice
mbdevpl Feb 16, 2025
a850edb
build: use python-boilerplates
mbdevpl Feb 16, 2025
5c98e46
chore: housekeeping
mbdevpl Feb 16, 2025
6015697
feat(cpp): test for presence of swig during import
mbdevpl Feb 16, 2025
2f9e8f7
test: temporarily disable obviously broken tests
mbdevpl Feb 16, 2025
ecfb381
fix: missing import
mbdevpl Feb 16, 2025
42ed3e1
test(fortran): move fortran apps tests to separate file
mbdevpl Feb 16, 2025
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
23 changes: 13 additions & 10 deletions .build/choose_gcc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -Eeuxo pipefail
# set -Eeuxo pipefail

# if [[ "$(uname)" == "Linux" ]]; then
# sudo update-alternatives \
Expand All @@ -20,14 +20,17 @@ set -Eeuxo pipefail
# fi

if [[ "$(uname)" == "Darwin" ]]; then
set -Eeuxo pipefail
sudo ln -s /usr/local/bin/gcc-$1 /usr/local/bin/gcc
sudo ln -s /usr/local/bin/g++-$1 /usr/local/bin/g++
sudo ln -s /usr/local/bin/cpp-$1 /usr/local/bin/cpp
BIN_ROOT_DIR="/usr/local/bin"
which gcc-$1
which gcc
sudo ln -s $(which gcc-$1) "${BIN_ROOT_DIR}/gcc"
which gcc
sudo ln -s $(which g++-$1) "${BIN_ROOT_DIR}/g++"
sudo ln -s $(which cpp-$1) "${BIN_ROOT_DIR}/cpp"
# sudo ln -s /usr/local/bin/gfortran-$1 /usr/local/bin/gfortran # already exists
sudo ln -s /usr/local/bin/gcc-ar-$1 /usr/local/bin/gcc-ar
sudo ln -s /usr/local/bin/gcc-nm-$1 /usr/local/bin/gcc-nm
sudo ln -s /usr/local/bin/gcc-ranlib-$1 /usr/local/bin/gcc-ranlib
sudo ln -s /usr/local/bin/gcov-$1 /usr/local/bin/gcov
sudo ln -s /usr/local/bin/gcov-dump-$1 /usr/local/bin/gcov-dump
sudo ln -s $(which gcc-ar-$1) "${BIN_ROOT_DIR}/gcc-ar"
sudo ln -s $(which gcc-nm-$1) "${BIN_ROOT_DIR}/gcc-nm"
sudo ln -s $(which gcc-ranlib-$1) "${BIN_ROOT_DIR}/gcc-ranlib"
sudo ln -s $(which gcov-$1) "${BIN_ROOT_DIR}/gcov"
sudo ln -s $(which gcov-dump-$1) "${BIN_ROOT_DIR}/gcov-dump"
fi
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
- package-ecosystem: pip
directory: /
schedule:
interval: monthly
versioning-strategy: increase-if-necessary
ignore:
- dependency-name: >-
*
update-types:
- version-update:semver-patch
31 changes: 31 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: actions

on:
push:
pull_request:
branches:
- $default-branch

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# TODO: restore 'macos-latest' and 'windows-latest' after fixing on linux
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: ['3.11', '3.12']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install -r requirements_ci.txt
- run: python -m coverage run --branch --source . -m unittest -v
# TODO: restore C, C++ and Fortran tests after fixing python
# - run: pip install -r requirements_all.txt
# - run: python -m coverage run --append --branch --source . -m unittest -v
- run: python -m coverage report --show-missing
- run: codecov
22 changes: 16 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,30 @@ matrix:
- os: linux
language: python
python: "3.7"
- os: linux
language: python
python: "3.8"
- os: osx
osx_image: xcode10.2
osx_image: xcode11.2
language: generic
env: TRAVIS_PYTHON_VERSION="3.5"
- os: osx
osx_image: xcode10.2
osx_image: xcode11.2
language: generic
env: TRAVIS_PYTHON_VERSION="3.6"
- os: osx
osx_image: xcode10.2
osx_image: xcode11.2
language: generic
env: TRAVIS_PYTHON_VERSION="3.7"
- os: osx
osx_image: xcode11.2
language: generic
env: TRAVIS_PYTHON_VERSION="3.8"

before_install:
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /; fi # https://github.com/pyenv/pyenv/issues/1219
- .build/choose_gcc.sh 8
- echo "${PATH}"
- which gcc
- .build/choose_gcc.sh 9
- |
set -e
if [[ "$(uname)" == "Darwin" ]]; then
Expand All @@ -58,15 +66,17 @@ before_install:
brew doctor 2>&1 | grep "/usr/local/include" | awk '{$1=$1;print}' | xargs -I _ mv _ /tmp/includes
fi
set +e
- which gcc
- gcc --version
- g++ --version
- swig -version
- gfortran --version
- java --version
- qwertyuiop
- .build/install_pyenv.sh
# apps
- git clone "https://github.com/mbdevpl/ffb-mini" "../ffb-mini"
- git clone "https://github.com/ECP-Astro/FLASH5.git" "../flash5"
- git clone "https://github.com/mbdevpl/FLASH5" "../flash5"
- git clone "https://github.com/mbdevpl/miranda_io" "../miranda_io"

install:
Expand Down
15 changes: 11 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
include setup_boilerplate.py
include *requirements.txt
include extras_requirements.json
include requirements.txt
include LICENSE
include NOTICE
include ./*/py.typed

include requirements_all.txt
include requirements_c.txt
include requirements_cpp.txt
include requirements_cython.txt
include requirements_fortran.txt
include requirements_opencl.txt

include requirements_test.txt
recursive-include ./transpyle/resources *.*
recursive-include ./test/examples *.*
include ./*/py.typed
3 changes: 2 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright 2017-2019 Mateusz Bysiek https://mbdevpl.github.io/
transpyle
Copyright (c) 2017-2025 Mateusz Bysiek https://mbdevpl.github.io/

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Human-oriented and high-performing transpiler for Python.
:target: https://pypi.org/project/transpyle
:alt: package version from PyPI

.. image:: https://travis-ci.org/mbdevpl/transpyle.svg?branch=master
:target: https://travis-ci.org/mbdevpl/transpyle
.. image:: https://travis-ci.com/mbdevpl/transpyle.svg?branch=master
:target: https://travis-ci.com/mbdevpl/transpyle
:alt: build status from Travis CI

.. image:: https://ci.appveyor.com/api/projects/status/github/mbdevpl/transpyle?branch=master&svg=true
Expand Down Expand Up @@ -286,7 +286,7 @@ The core functionality of transpyle is platform-independent. However, as support
depends on presence of additional software, some functionality might be limited/unavailable
on selected platforms.

Transpyle is fully tested on Linux, and partially tested on OS X and Windows.
Transpyle is fully tested on Linux, and partially tested on macOS and Windows.


Installation
Expand Down
12 changes: 3 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@ version: "{build}"

environment:
matrix:
- ARCHITECTURE: "x86"
PYTHON_VERSION: "3.5"
PYTHON: "C:\\Python35"
- ARCHITECTURE: "x64"
PYTHON_VERSION: "3.5"
PYTHON: "C:\\Python35-x64"
- ARCHITECTURE: "x86"
PYTHON_VERSION: "3.6"
PYTHON: "C:\\Python36"
- ARCHITECTURE: "x64"
PYTHON_VERSION: "3.6"
PYTHON: "C:\\Python36-x64"
- ARCHITECTURE: "x86"
PYTHON_VERSION: "3.7"
PYTHON: "C:\\Python37"
- ARCHITECTURE: "x64"
PYTHON_VERSION: "3.7"
PYTHON: "C:\\Python37-x64"
- ARCHITECTURE: "x64"
PYTHON_VERSION: "3.8"
PYTHON: "C:\\Python37-x64"

init:
- set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
Expand Down
3 changes: 0 additions & 3 deletions ci_requirements.txt

This file was deleted.

8 changes: 0 additions & 8 deletions extras_requirements.json

This file was deleted.

37 changes: 36 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
[build-system]
requires=['docutils ~= 0.15.1', 'setuptools >= 41.0', 'version-query >= 1.0.5, == 1.*', 'wheel >= 0.33']
requires = [
'boilerplates[setup] ~= 1.0'
]

[tool.flake8]
max-line-length = 100
max-doc-length = 100

[tool.pydocstyle]
ignore = [
'D102', 'D103', 'D105', 'D107',
'D203', 'D213',
'D406', 'D407', 'D412', 'D413'
]

[tool.pylint.MASTER]
load-plugins = [
'pylint.extensions.broad_try_clause',
'pylint.extensions.mccabe',
'pylint.extensions.no_self_use',
'pylint.extensions.redefined_variable_type'
]

[tool.pylint.'MESSAGES CONTROL']
docstring-min-length = 5

[tool.pylint.SIMILARITIES]
ignore-imports = 'yes'
min-similarity-lines = 5

[tool.pylint.BASIC]
no-docstring-rgx = '^(test)?_|.*Tests$'
unsafe-load-any-extension = 'yes'

[tool.pylint.REPORTS]
output-format = 'colorized'
13 changes: 6 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
argunparse
astunparse
colorama
colorlog
argunparse ~= 0.1.2
astunparse ~= 1.6
colorama ~= 0.4.3
colorlog ~= 4.1
encrypted-config
horast ~= 0.4.0
pandas
setuptools >= 41.0
pandas ~= 1.0
static-typing ~= 0.2.7
typed_ast ~= 1.4
typed-astunparse >= 2.1.4, == 2.*
version-query >= 1.0.5, == 1.*
version-query ~= 1.5
5 changes: 5 additions & 0 deletions requirements_all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r requirements_c.txt
# -r requirements_cpp.txt
# -r requirements_cython.txt
-r requirements_fortran.txt
# -r requirements_opencl.txt
3 changes: 3 additions & 0 deletions requirements_c.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r requirements_cython.txt
pcpp ~= 1.30
pycparser ~= 2.22
3 changes: 3 additions & 0 deletions requirements_ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r requirements_test.txt
codecov >= 2.0.15
coverage >= 5.0.3
Empty file added requirements_cpp.txt
Empty file.
1 change: 1 addition & 0 deletions requirements_cython.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cython ~= 0.29.14
2 changes: 2 additions & 0 deletions requirements_fortran.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpy >= 1.18
open_fortran_parser ~= 0.6.0
1 change: 1 addition & 0 deletions requirements_opencl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyopencl >= 2019.1
4 changes: 4 additions & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r requirements.txt
boilerplates[packaging_tests] ~= 1.0
numba >= 0.47
timing ~= 0.4
28 changes: 13 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
"""Setup script for transpyle package."""

import json
import pathlib
import setup_boilerplate
import boilerplates.setup


class Package(setup_boilerplate.Package):
class Package(boilerplates.setup.Package):
"""Package metadata."""

name = 'transpyle'
description = 'performance-oriented transpiler for Python'
description = 'Performance-oriented transpiler for Python.'
url = 'https://github.com/mbdevpl/transpyle'
classifiers = [
'Development Status :: 2 - Pre-Alpha',
Expand All @@ -20,9 +18,8 @@ class Package(setup_boilerplate.Package):
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Education',
'Topic :: Scientific/Engineering',
Expand All @@ -31,14 +28,15 @@ class Package(setup_boilerplate.Package):
'Topic :: Software Development :: Pre-processors',
'Topic :: Utilities']
keywords = ['compiler', 'just-in-time', 'source-to-source', 'transpilation', 'transpiler']
extras_require = {}
entry_points = {
'console_scripts': ['transpyle = transpyle.__main__:main']}
extras_require = {
'all': boilerplates.setup.parse_requirements('requirements_all.txt'),
'c': boilerplates.setup.parse_requirements('requirements_c.txt'),
'cpp': boilerplates.setup.parse_requirements('requirements_cpp.txt'),
'cython': boilerplates.setup.parse_requirements('requirements_cython.txt'),
'fortran': boilerplates.setup.parse_requirements('requirements_fortran.txt'),
'opencl': boilerplates.setup.parse_requirements('requirements_opencl.txt')}
entry_points = {'console_scripts': ['transpyle = transpyle.__main__:main']}


if __name__ == '__main__':
_HERE = pathlib.Path(__file__).parent
_EXTRAS = pathlib.Path(_HERE, 'extras_requirements.json')
with _EXTRAS.open() as json_file:
Package.extras_require = json.load(json_file)
Package.setup()
Loading
Loading