diff --git a/MANIFEST.in b/MANIFEST.in index 9ec05488..e09b5cd3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,10 +1,10 @@ include README.md include LICENSE -include src/backend/DirectX/*.py -include src/backend/Metal/*.py -include src/backend/Opengl/*.py -include src/translator/*.py -include src/translator/codegen/*.py +include backend/DirectX/*.py +include backend/Metal/*.py +include backend/Opengl/*.py +include translator/*.py +include translator/codegen/*.py include crosstl.py include crosstl -include corsstl/src/ +include corsstl/ diff --git a/crosstl/_crosstl.py b/crosstl/_crosstl.py index a93d3341..e07ce122 100644 --- a/crosstl/_crosstl.py +++ b/crosstl/_crosstl.py @@ -1,12 +1,12 @@ -from .src import translator -from .src.translator.lexer import Lexer -from .src.translator.parser import Parser -from .src.translator.codegen import directx_codegen, metal_codegen, opengl_codegen -from .src.translator.ast import ASTNode -from .src.backend.DirectX import * -from .src.backend.Metal import * -from .src.backend.Opengl import * -from .src.backend.slang import * +from . import translator +from .translator.lexer import Lexer +from .translator.parser import Parser +from .translator.codegen import directx_codegen, metal_codegen, opengl_codegen +from .translator.ast import ASTNode +from .backend.DirectX import * +from .backend.Metal import * +from .backend.Opengl import * +from .backend.slang import * def translate(file_path: str, backend: str = "cgl", save_shader: str = None) -> str: diff --git a/crosstl/src/backend/DirectX/DirectxAst.py b/crosstl/backend/DirectX/DirectxAst.py similarity index 100% rename from crosstl/src/backend/DirectX/DirectxAst.py rename to crosstl/backend/DirectX/DirectxAst.py diff --git a/crosstl/src/backend/DirectX/DirectxCrossGLCodeGen.py b/crosstl/backend/DirectX/DirectxCrossGLCodeGen.py similarity index 100% rename from crosstl/src/backend/DirectX/DirectxCrossGLCodeGen.py rename to crosstl/backend/DirectX/DirectxCrossGLCodeGen.py diff --git a/crosstl/src/backend/DirectX/DirectxLexer.py b/crosstl/backend/DirectX/DirectxLexer.py similarity index 100% rename from crosstl/src/backend/DirectX/DirectxLexer.py rename to crosstl/backend/DirectX/DirectxLexer.py diff --git a/crosstl/src/backend/DirectX/DirectxParser.py b/crosstl/backend/DirectX/DirectxParser.py similarity index 100% rename from crosstl/src/backend/DirectX/DirectxParser.py rename to crosstl/backend/DirectX/DirectxParser.py diff --git a/crosstl/src/backend/DirectX/__init__.py b/crosstl/backend/DirectX/__init__.py similarity index 100% rename from crosstl/src/backend/DirectX/__init__.py rename to crosstl/backend/DirectX/__init__.py diff --git a/crosstl/src/backend/Metal/MetalAst.py b/crosstl/backend/Metal/MetalAst.py similarity index 100% rename from crosstl/src/backend/Metal/MetalAst.py rename to crosstl/backend/Metal/MetalAst.py diff --git a/crosstl/src/backend/Metal/MetalCrossGLCodeGen.py b/crosstl/backend/Metal/MetalCrossGLCodeGen.py similarity index 100% rename from crosstl/src/backend/Metal/MetalCrossGLCodeGen.py rename to crosstl/backend/Metal/MetalCrossGLCodeGen.py diff --git a/crosstl/src/backend/Metal/MetalLexer.py b/crosstl/backend/Metal/MetalLexer.py similarity index 100% rename from crosstl/src/backend/Metal/MetalLexer.py rename to crosstl/backend/Metal/MetalLexer.py diff --git a/crosstl/src/backend/Metal/MetalParser.py b/crosstl/backend/Metal/MetalParser.py similarity index 100% rename from crosstl/src/backend/Metal/MetalParser.py rename to crosstl/backend/Metal/MetalParser.py diff --git a/crosstl/src/backend/Metal/__init__.py b/crosstl/backend/Metal/__init__.py similarity index 100% rename from crosstl/src/backend/Metal/__init__.py rename to crosstl/backend/Metal/__init__.py diff --git a/crosstl/src/backend/Mojo/MojoAst.py b/crosstl/backend/Mojo/MojoAst.py similarity index 100% rename from crosstl/src/backend/Mojo/MojoAst.py rename to crosstl/backend/Mojo/MojoAst.py diff --git a/crosstl/src/backend/Mojo/MojoLexer.py b/crosstl/backend/Mojo/MojoLexer.py similarity index 100% rename from crosstl/src/backend/Mojo/MojoLexer.py rename to crosstl/backend/Mojo/MojoLexer.py diff --git a/crosstl/src/backend/Mojo/MojoParser.py b/crosstl/backend/Mojo/MojoParser.py similarity index 100% rename from crosstl/src/backend/Mojo/MojoParser.py rename to crosstl/backend/Mojo/MojoParser.py diff --git a/crosstl/src/backend/Opengl/OpenglAst.py b/crosstl/backend/Opengl/OpenglAst.py similarity index 100% rename from crosstl/src/backend/Opengl/OpenglAst.py rename to crosstl/backend/Opengl/OpenglAst.py diff --git a/crosstl/src/backend/Opengl/OpenglLexer.py b/crosstl/backend/Opengl/OpenglLexer.py similarity index 100% rename from crosstl/src/backend/Opengl/OpenglLexer.py rename to crosstl/backend/Opengl/OpenglLexer.py diff --git a/crosstl/src/backend/Opengl/OpenglParser.py b/crosstl/backend/Opengl/OpenglParser.py similarity index 100% rename from crosstl/src/backend/Opengl/OpenglParser.py rename to crosstl/backend/Opengl/OpenglParser.py diff --git a/crosstl/src/backend/Opengl/__init__.py b/crosstl/backend/Opengl/__init__.py similarity index 100% rename from crosstl/src/backend/Opengl/__init__.py rename to crosstl/backend/Opengl/__init__.py diff --git a/crosstl/src/backend/Opengl/openglCrossglCodegen.py b/crosstl/backend/Opengl/openglCrossglCodegen.py similarity index 100% rename from crosstl/src/backend/Opengl/openglCrossglCodegen.py rename to crosstl/backend/Opengl/openglCrossglCodegen.py diff --git a/crosstl/src/backend/Vulkan/VulkanAst.py b/crosstl/backend/Vulkan/VulkanAst.py similarity index 100% rename from crosstl/src/backend/Vulkan/VulkanAst.py rename to crosstl/backend/Vulkan/VulkanAst.py diff --git a/crosstl/src/backend/Vulkan/VulkanLexer.py b/crosstl/backend/Vulkan/VulkanLexer.py similarity index 100% rename from crosstl/src/backend/Vulkan/VulkanLexer.py rename to crosstl/backend/Vulkan/VulkanLexer.py diff --git a/crosstl/src/backend/Vulkan/VulkanParser.py b/crosstl/backend/Vulkan/VulkanParser.py similarity index 100% rename from crosstl/src/backend/Vulkan/VulkanParser.py rename to crosstl/backend/Vulkan/VulkanParser.py diff --git a/crosstl/src/backend/slang/SlangAst.py b/crosstl/backend/slang/SlangAst.py similarity index 100% rename from crosstl/src/backend/slang/SlangAst.py rename to crosstl/backend/slang/SlangAst.py diff --git a/crosstl/src/backend/slang/SlangCrossGLCodeGen.py b/crosstl/backend/slang/SlangCrossGLCodeGen.py similarity index 100% rename from crosstl/src/backend/slang/SlangCrossGLCodeGen.py rename to crosstl/backend/slang/SlangCrossGLCodeGen.py diff --git a/crosstl/src/backend/slang/SlangLexer.py b/crosstl/backend/slang/SlangLexer.py similarity index 100% rename from crosstl/src/backend/slang/SlangLexer.py rename to crosstl/backend/slang/SlangLexer.py diff --git a/crosstl/src/backend/slang/SlangParser.py b/crosstl/backend/slang/SlangParser.py similarity index 100% rename from crosstl/src/backend/slang/SlangParser.py rename to crosstl/backend/slang/SlangParser.py diff --git a/crosstl/src/backend/slang/__init__.py b/crosstl/backend/slang/__init__.py similarity index 100% rename from crosstl/src/backend/slang/__init__.py rename to crosstl/backend/slang/__init__.py diff --git a/crosstl/src/translator/codegen/__init__.py b/crosstl/src/translator/codegen/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/crosstl/src/translator/__init__.py b/crosstl/translator/__init__.py similarity index 100% rename from crosstl/src/translator/__init__.py rename to crosstl/translator/__init__.py diff --git a/crosstl/src/translator/ast.py b/crosstl/translator/ast.py similarity index 100% rename from crosstl/src/translator/ast.py rename to crosstl/translator/ast.py diff --git a/crosstl/src/__init__.py b/crosstl/translator/codegen/__init__.py similarity index 100% rename from crosstl/src/__init__.py rename to crosstl/translator/codegen/__init__.py diff --git a/crosstl/src/translator/codegen/directx_codegen.py b/crosstl/translator/codegen/directx_codegen.py similarity index 100% rename from crosstl/src/translator/codegen/directx_codegen.py rename to crosstl/translator/codegen/directx_codegen.py diff --git a/crosstl/src/translator/codegen/metal_codegen.py b/crosstl/translator/codegen/metal_codegen.py similarity index 100% rename from crosstl/src/translator/codegen/metal_codegen.py rename to crosstl/translator/codegen/metal_codegen.py diff --git a/crosstl/src/translator/codegen/opengl_codegen.py b/crosstl/translator/codegen/opengl_codegen.py similarity index 100% rename from crosstl/src/translator/codegen/opengl_codegen.py rename to crosstl/translator/codegen/opengl_codegen.py diff --git a/crosstl/src/translator/codegen/slang_codegen.py b/crosstl/translator/codegen/slang_codegen.py similarity index 100% rename from crosstl/src/translator/codegen/slang_codegen.py rename to crosstl/translator/codegen/slang_codegen.py diff --git a/crosstl/src/translator/codegen/vulkan_codegen.py b/crosstl/translator/codegen/vulkan_codegen.py similarity index 100% rename from crosstl/src/translator/codegen/vulkan_codegen.py rename to crosstl/translator/codegen/vulkan_codegen.py diff --git a/crosstl/src/translator/lexer.py b/crosstl/translator/lexer.py similarity index 100% rename from crosstl/src/translator/lexer.py rename to crosstl/translator/lexer.py diff --git a/crosstl/src/translator/parser.py b/crosstl/translator/parser.py similarity index 100% rename from crosstl/src/translator/parser.py rename to crosstl/translator/parser.py diff --git a/setup.py b/setup.py index ef90fec3..2b43d44d 100644 --- a/setup.py +++ b/setup.py @@ -1,32 +1,26 @@ -from setuptools import setup, find_packages - - -def prep(line): - return line.split(" ")[0].split("#")[0].split(",")[0] +from setuptools import setup setup( name="crosstl", packages=[ "crosstl", - "crosstl/src", - "crosstl/src/translator/", - "crosstl/src/translator/codegen/", - "crosstl/src/backend", - "crosstl/src/backend/DirectX", - "crosstl/src/backend/Metal/", - "crosstl/src/backend/Opengl/", + "crosstl/translator/", + "crosstl/translator/codegen/", + "crosstl/backend", + "crosstl/backend/DirectX", + "crosstl/backend/Metal/", + "crosstl/backend/Opengl/", ], version="0.0.1.3", author="CrossGL team", - author_email="vaatsalya@crossgl.net", - description="CrossGL: Revolutionizing Shader Development", + author_email="nripesh@crossgl.net", + description="CrossTL: Revolutionizing Shader Development", long_description=open("README.md", "r", -1, "UTF8").read(), long_description_content_type="text/markdown", url="https://crossgl.net/", project_urls={"Documentation": "https://crossgl.github.io/index.html"}, include_package_dats=True, - # packages=find_packages(), classifiers=[ "Programming Language :: Python :: 3", "Operating System :: OS Independent", diff --git a/tests/test_backend/test_directx/test_codegen.py b/tests/test_backend/test_directx/test_codegen.py index 07ae81b6..7d746208 100644 --- a/tests/test_backend/test_directx/test_codegen.py +++ b/tests/test_backend/test_directx/test_codegen.py @@ -1,6 +1,6 @@ -from crosstl.src.backend.DirectX import DirectxCrossGLCodeGen -from crosstl.src.backend.DirectX.DirectxLexer import HLSLLexer -from crosstl.src.backend.DirectX.DirectxParser import HLSLParser +from crosstl.backend.DirectX import DirectxCrossGLCodeGen +from crosstl.backend.DirectX.DirectxLexer import HLSLLexer +from crosstl.backend.DirectX.DirectxParser import HLSLParser import pytest from typing import List diff --git a/tests/test_backend/test_directx/test_lexer.py b/tests/test_backend/test_directx/test_lexer.py index cb5ea7fb..0b12c360 100644 --- a/tests/test_backend/test_directx/test_lexer.py +++ b/tests/test_backend/test_directx/test_lexer.py @@ -1,6 +1,6 @@ import pytest from typing import List -from crosstl.src.backend.DirectX.DirectxLexer import HLSLLexer +from crosstl.backend.DirectX.DirectxLexer import HLSLLexer def tokenize_code(code: str) -> List: diff --git a/tests/test_backend/test_directx/test_parser.py b/tests/test_backend/test_directx/test_parser.py index 809a1825..dd73e9df 100644 --- a/tests/test_backend/test_directx/test_parser.py +++ b/tests/test_backend/test_directx/test_parser.py @@ -1,7 +1,7 @@ import pytest from typing import List -from crosstl.src.backend.DirectX.DirectxLexer import HLSLLexer -from crosstl.src.backend.DirectX.DirectxParser import HLSLParser +from crosstl.backend.DirectX.DirectxLexer import HLSLLexer +from crosstl.backend.DirectX.DirectxParser import HLSLParser def parse_code(tokens: List): diff --git a/tests/test_backend/test_metal/test_codegen.py b/tests/test_backend/test_metal/test_codegen.py index d2f485ee..72e4f74d 100644 --- a/tests/test_backend/test_metal/test_codegen.py +++ b/tests/test_backend/test_metal/test_codegen.py @@ -1,8 +1,8 @@ import pytest from typing import List -from crosstl.src.backend.Metal.MetalLexer import MetalLexer -from crosstl.src.backend.Metal.MetalParser import MetalParser -from crosstl.src.backend.Metal.MetalCrossGLCodeGen import MetalToCrossGLConverter +from crosstl.backend.Metal.MetalLexer import MetalLexer +from crosstl.backend.Metal.MetalParser import MetalParser +from crosstl.backend.Metal.MetalCrossGLCodeGen import MetalToCrossGLConverter def tokenize_code(code: str) -> List: diff --git a/tests/test_backend/test_metal/test_lexer.py b/tests/test_backend/test_metal/test_lexer.py index 9ade73a4..eaaf4b57 100644 --- a/tests/test_backend/test_metal/test_lexer.py +++ b/tests/test_backend/test_metal/test_lexer.py @@ -1,6 +1,6 @@ import pytest from typing import List -from crosstl.src.backend.Metal.MetalLexer import MetalLexer +from crosstl.backend.Metal.MetalLexer import MetalLexer def tokenize_code(code: str) -> List: diff --git a/tests/test_backend/test_metal/test_parser.py b/tests/test_backend/test_metal/test_parser.py index f3beef03..c30c416f 100644 --- a/tests/test_backend/test_metal/test_parser.py +++ b/tests/test_backend/test_metal/test_parser.py @@ -1,7 +1,7 @@ import pytest from typing import List -from crosstl.src.backend.Metal.MetalLexer import MetalLexer -from crosstl.src.backend.Metal.MetalParser import MetalParser +from crosstl.backend.Metal.MetalLexer import MetalLexer +from crosstl.backend.Metal.MetalParser import MetalParser def tokenize_code(code: str) -> List: diff --git a/tests/test_backend/test_opengl/test_codegen.py b/tests/test_backend/test_opengl/test_codegen.py index bd29a708..09c1d732 100644 --- a/tests/test_backend/test_opengl/test_codegen.py +++ b/tests/test_backend/test_opengl/test_codegen.py @@ -1,8 +1,8 @@ -from crosstl.src.backend.Opengl.OpenglLexer import GLSLLexer +from crosstl.backend.Opengl.OpenglLexer import GLSLLexer import pytest from typing import List -from crosstl.src.backend.Opengl.OpenglParser import GLSLParser -from crosstl.src.backend.Opengl.openglCrossglCodegen import GLSLToCrossGLConverter +from crosstl.backend.Opengl.OpenglParser import GLSLParser +from crosstl.backend.Opengl.openglCrossglCodegen import GLSLToCrossGLConverter def tokenize_code(code: str) -> List: diff --git a/tests/test_backend/test_opengl/test_lexer.py b/tests/test_backend/test_opengl/test_lexer.py index a9700052..00742224 100644 --- a/tests/test_backend/test_opengl/test_lexer.py +++ b/tests/test_backend/test_opengl/test_lexer.py @@ -1,4 +1,4 @@ -from crosstl.src.backend.Opengl.OpenglLexer import GLSLLexer +from crosstl.backend.Opengl.OpenglLexer import GLSLLexer import pytest from typing import List diff --git a/tests/test_backend/test_opengl/test_parser.py b/tests/test_backend/test_opengl/test_parser.py index 58aaa044..44748cae 100644 --- a/tests/test_backend/test_opengl/test_parser.py +++ b/tests/test_backend/test_opengl/test_parser.py @@ -1,7 +1,7 @@ -from crosstl.src.backend.Opengl.OpenglLexer import GLSLLexer +from crosstl.backend.Opengl.OpenglLexer import GLSLLexer import pytest from typing import List -from crosstl.src.backend.Opengl.OpenglParser import GLSLParser +from crosstl.backend.Opengl.OpenglParser import GLSLParser def tokenize_code(code: str) -> List: diff --git a/tests/test_backend/test_slang/test_codegen.py b/tests/test_backend/test_slang/test_codegen.py index 7ab8feeb..6a00430f 100644 --- a/tests/test_backend/test_slang/test_codegen.py +++ b/tests/test_backend/test_slang/test_codegen.py @@ -1,6 +1,6 @@ -from crosstl.src.backend.slang import SlangCrossGLCodeGen -from crosstl.src.backend.slang import SlangLexer -from crosstl.src.backend.slang import SlangParser +from crosstl.backend.slang import SlangCrossGLCodeGen +from crosstl.backend.slang import SlangLexer +from crosstl.backend.slang import SlangParser import pytest from typing import List diff --git a/tests/test_backend/test_slang/test_lexer.py b/tests/test_backend/test_slang/test_lexer.py index 798f2b6b..adf8b744 100644 --- a/tests/test_backend/test_slang/test_lexer.py +++ b/tests/test_backend/test_slang/test_lexer.py @@ -1,6 +1,6 @@ import pytest from typing import List -from crosstl.src.backend.slang.SlangLexer import SlangLexer +from crosstl.backend.slang.SlangLexer import SlangLexer def tokenize_code(code: str) -> List: diff --git a/tests/test_backend/test_slang/test_parser.py b/tests/test_backend/test_slang/test_parser.py index dac10aab..34976622 100644 --- a/tests/test_backend/test_slang/test_parser.py +++ b/tests/test_backend/test_slang/test_parser.py @@ -1,7 +1,7 @@ import pytest from typing import List -from crosstl.src.backend.slang import SlangLexer -from crosstl.src.backend.slang import SlangParser +from crosstl.backend.slang import SlangLexer +from crosstl.backend.slang import SlangParser def parse_code(tokens: List): diff --git a/tests/test_translator/test_codegen/test_directx_codegen.py b/tests/test_translator/test_codegen/test_directx_codegen.py index afff181d..c55d5929 100644 --- a/tests/test_translator/test_codegen/test_directx_codegen.py +++ b/tests/test_translator/test_codegen/test_directx_codegen.py @@ -1,8 +1,8 @@ -from crosstl.src.translator.lexer import Lexer +from crosstl.translator.lexer import Lexer import pytest from typing import List -from crosstl.src.translator.parser import Parser -from crosstl.src.translator.codegen.directx_codegen import HLSLCodeGen +from crosstl.translator.parser import Parser +from crosstl.translator.codegen.directx_codegen import HLSLCodeGen def tokenize_code(code: str) -> List: diff --git a/tests/test_translator/test_codegen/test_metal_codegen.py b/tests/test_translator/test_codegen/test_metal_codegen.py index b6a5cfd2..8ed86810 100644 --- a/tests/test_translator/test_codegen/test_metal_codegen.py +++ b/tests/test_translator/test_codegen/test_metal_codegen.py @@ -1,8 +1,8 @@ -from crosstl.src.translator.lexer import Lexer +from crosstl.translator.lexer import Lexer import pytest from typing import List -from crosstl.src.translator.parser import Parser -from crosstl.src.translator.codegen.metal_codegen import MetalCodeGen +from crosstl.translator.parser import Parser +from crosstl.translator.codegen.metal_codegen import MetalCodeGen def tokenize_code(code: str) -> List: diff --git a/tests/test_translator/test_codegen/test_opengl_codegen.py b/tests/test_translator/test_codegen/test_opengl_codegen.py index b52961fc..a257c55d 100644 --- a/tests/test_translator/test_codegen/test_opengl_codegen.py +++ b/tests/test_translator/test_codegen/test_opengl_codegen.py @@ -1,8 +1,8 @@ -from crosstl.src.translator.lexer import Lexer +from crosstl.translator.lexer import Lexer import pytest from typing import List -from crosstl.src.translator.parser import Parser -from crosstl.src.translator.codegen.opengl_codegen import GLSLCodeGen +from crosstl.translator.parser import Parser +from crosstl.translator.codegen.opengl_codegen import GLSLCodeGen def tokenize_code(code: str) -> List: diff --git a/tests/test_translator/test_codegen/test_slang_codegen.py b/tests/test_translator/test_codegen/test_slang_codegen.py index 9b315fe9..7501fa65 100644 --- a/tests/test_translator/test_codegen/test_slang_codegen.py +++ b/tests/test_translator/test_codegen/test_slang_codegen.py @@ -1,8 +1,8 @@ -from crosstl.src.translator.lexer import Lexer +from crosstl.translator.lexer import Lexer import pytest from typing import List -from crosstl.src.translator.parser import Parser -from crosstl.src.translator.codegen.slang_codegen import SlangCodeGen +from crosstl.translator.parser import Parser +from crosstl.translator.codegen.slang_codegen import SlangCodeGen def tokenize_code(code: str) -> List: diff --git a/tests/test_translator/test_lexer.py b/tests/test_translator/test_lexer.py index 387680cf..abff042f 100644 --- a/tests/test_translator/test_lexer.py +++ b/tests/test_translator/test_lexer.py @@ -1,4 +1,4 @@ -from crosstl.src.translator.lexer import Lexer +from crosstl.translator.lexer import Lexer import pytest from typing import List diff --git a/tests/test_translator/test_parser.py b/tests/test_translator/test_parser.py index 737e1d66..8f498322 100644 --- a/tests/test_translator/test_parser.py +++ b/tests/test_translator/test_parser.py @@ -1,7 +1,7 @@ -from crosstl.src.translator.lexer import Lexer +from crosstl.translator.lexer import Lexer import pytest from typing import List -from crosstl.src.translator.parser import Parser +from crosstl.translator.parser import Parser def tokenize_code(code: str) -> List: