diff --git a/Cargo.lock b/Cargo.lock index 2d61467b91..c01dc468ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -957,15 +957,15 @@ dependencies = [ "cpython 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustpython_compiler 0.1.0", - "rustpython_parser 0.0.1", - "rustpython_vm 0.1.0", + "rustpython-compiler 0.1.0", + "rustpython-parser 0.0.1", + "rustpython-vm 0.1.0", "rustyline 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "rustpython_bytecode" +name = "rustpython-bytecode" version = "0.1.0" dependencies = [ "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -975,30 +975,30 @@ dependencies = [ ] [[package]] -name = "rustpython_compiler" +name = "rustpython-compiler" version = "0.1.0" dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "num-complex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustpython_bytecode 0.1.0", - "rustpython_parser 0.0.1", + "rustpython-bytecode 0.1.0", + "rustpython-parser 0.0.1", ] [[package]] -name = "rustpython_derive" +name = "rustpython-derive" version = "0.1.0" dependencies = [ "bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-hack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "rustpython_bytecode 0.1.0", - "rustpython_compiler 0.1.0", + "rustpython-bytecode 0.1.0", + "rustpython-compiler 0.1.0", "syn 0.15.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "rustpython_parser" +name = "rustpython-parser" version = "0.0.1" dependencies = [ "lalrpop 0.16.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1014,7 +1014,7 @@ dependencies = [ ] [[package]] -name = "rustpython_vm" +name = "rustpython-vm" version = "0.1.0" dependencies = [ "bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1043,10 +1043,10 @@ dependencies = [ "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version_runtime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rustpython_bytecode 0.1.0", - "rustpython_compiler 0.1.0", - "rustpython_derive 0.1.0", - "rustpython_parser 0.0.1", + "rustpython-bytecode 0.1.0", + "rustpython-compiler 0.1.0", + "rustpython-derive 0.1.0", + "rustpython-parser 0.0.1", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1069,9 +1069,9 @@ dependencies = [ "futures 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "js-sys 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustpython_compiler 0.1.0", - "rustpython_parser 0.0.1", - "rustpython_vm 0.1.0", + "rustpython-compiler 0.1.0", + "rustpython-parser 0.0.1", + "rustpython-vm 0.1.0", "serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)", "serde-wasm-bindgen 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 45c5c940d3..b92473d6db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rustpython" version = "0.0.1" -authors = ["Windel Bouwman ", "Shing Lyu "] +authors = ["RustPython Team"] edition = "2018" [workspace] @@ -16,9 +16,9 @@ path = "./benchmarks/bench.rs" log="0.4.1" env_logger="0.5.10" clap = "2.31.2" -rustpython_compiler = {path = "compiler"} -rustpython_parser = {path = "parser"} -rustpython_vm = {path = "vm"} +rustpython-compiler = {path = "compiler"} +rustpython-parser = {path = "parser"} +rustpython-vm = {path = "vm"} rustyline = "4.1.0" xdg = "2.2.0" diff --git a/bytecode/Cargo.toml b/bytecode/Cargo.toml index 25a9dd3a3e..fad46c1757 100644 --- a/bytecode/Cargo.toml +++ b/bytecode/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "rustpython_bytecode" +name = "rustpython-bytecode" version = "0.1.0" -authors = ["Windel Bouwman "] +authors = ["RustPython Team"] edition = "2018" [dependencies] diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index dccc3b07e0..8fdb37871a 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "rustpython_compiler" +name = "rustpython-compiler" version = "0.1.0" -authors = ["coolreader18 <33094578+coolreader18@users.noreply.github.com>", "Windel Bouwman "] +authors = ["RustPython Team"] edition = "2018" [dependencies] -rustpython_bytecode = { path = "../bytecode" } -rustpython_parser = { path = "../parser" } +rustpython-bytecode = { path = "../bytecode" } +rustpython-parser = { path = "../parser" } num-complex = { version = "0.2", features = ["serde"] } log = "0.3" diff --git a/derive/Cargo.toml b/derive/Cargo.toml index bcf56dc6fa..fa304d0bdd 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "rustpython_derive" +name = "rustpython-derive" version = "0.1.0" -authors = ["Joey "] +authors = ["RustPython Team"] edition = "2018" [lib] @@ -11,7 +11,7 @@ proc-macro = true syn = { version = "0.15.29", features = ["full"] } quote = "0.6.11" proc-macro2 = "0.4.27" -rustpython_compiler = { path = "../compiler" } -rustpython_bytecode = { path = "../bytecode" } +rustpython-compiler = { path = "../compiler" } +rustpython-bytecode = { path = "../bytecode" } bincode = "1.1" proc-macro-hack = "0.5" diff --git a/parser/Cargo.toml b/parser/Cargo.toml index 5d10344204..af0b19d39f 100644 --- a/parser/Cargo.toml +++ b/parser/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "rustpython_parser" +name = "rustpython-parser" version = "0.0.1" -authors = [ "Shing Lyu", "Windel Bouwman" ] +authors = [ "RustPython Team" ] build = "build.rs" edition = "2018" diff --git a/parser/src/parser.rs b/parser/src/parser.rs index dd58bd11db..eee4193105 100644 --- a/parser/src/parser.rs +++ b/parser/src/parser.rs @@ -44,7 +44,6 @@ pub fn parse_statement(source: &str) -> Result, Parse /// # Example /// ``` /// extern crate num_bigint; -/// extern crate rustpython_parser; /// use num_bigint::BigInt; /// use rustpython_parser::{parser, ast}; /// let expr = parser::parse_expression("1+2").unwrap(); diff --git a/src/main.rs b/src/main.rs index bcd8c9ccd3..ba6f097ec9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,8 +3,6 @@ extern crate clap; extern crate env_logger; #[macro_use] extern crate log; -extern crate rustpython_parser; -extern crate rustpython_vm; extern crate rustyline; use clap::{App, Arg}; diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 77df865c83..6c2533cb3f 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "rustpython_vm" +name = "rustpython-vm" version = "0.1.0" -authors = ["Shing Lyu "] +authors = ["RustPython Team"] edition = "2018" [features] -default = ["rustpython_parser", "rustpython_compiler"] +default = ["rustpython-parser", "rustpython-compiler"] [dependencies] # Crypto: @@ -23,10 +23,10 @@ num-integer = "0.1.39" num-rational = "0.2.1" rand = "0.5" log = "0.3" -rustpython_derive = {path = "../derive"} -rustpython_parser = {path = "../parser", optional = true} -rustpython_compiler = {path = "../compiler", optional = true} -rustpython_bytecode = { path = "../bytecode" } +rustpython-derive = {path = "../derive"} +rustpython-parser = {path = "../parser", optional = true} +rustpython-compiler = {path = "../compiler", optional = true} +rustpython-bytecode = { path = "../bytecode" } serde = { version = "1.0.66", features = ["derive"] } serde_json = "1.0.26" byteorder = "1.2.6" diff --git a/vm/src/builtins.rs b/vm/src/builtins.rs index 8c76790cee..fa05febf68 100644 --- a/vm/src/builtins.rs +++ b/vm/src/builtins.rs @@ -18,7 +18,7 @@ use crate::obj::objint::{self, PyIntRef}; use crate::obj::objiter; use crate::obj::objstr::{self, PyString, PyStringRef}; use crate::obj::objtype::{self, PyClassRef}; -#[cfg(feature = "rustpython_compiler")] +#[cfg(feature = "rustpython-compiler")] use rustpython_compiler::compile; use crate::frame::Scope; @@ -99,7 +99,7 @@ struct CompileArgs { optimize: OptionalArg, } -#[cfg(feature = "rustpython_compiler")] +#[cfg(feature = "rustpython-compiler")] fn builtin_compile(args: CompileArgs, vm: &VirtualMachine) -> PyResult { // TODO: compile::compile should probably get bytes let source = match args.source { @@ -155,7 +155,7 @@ fn builtin_divmod(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult { /// Implements `eval`. /// See also: https://docs.python.org/3/library/functions.html#eval -#[cfg(feature = "rustpython_compiler")] +#[cfg(feature = "rustpython-compiler")] fn builtin_eval(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult { // TODO: support any mapping for `locals` arg_check!( @@ -187,7 +187,7 @@ fn builtin_eval(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult { /// Implements `exec` /// https://docs.python.org/3/library/functions.html#exec -#[cfg(feature = "rustpython_compiler")] +#[cfg(feature = "rustpython-compiler")] fn builtin_exec(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult { arg_check!( vm, @@ -789,7 +789,7 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef) { #[cfg(not(target_arch = "wasm32"))] let open = vm.ctx.new_rustfunc(io_open); - #[cfg(feature = "rustpython_compiler")] + #[cfg(feature = "rustpython-compiler")] { extend_module!(vm, module, { "compile" => ctx.new_rustfunc(builtin_compile), diff --git a/vm/src/import.rs b/vm/src/import.rs index d6c5e55769..10d2175054 100644 --- a/vm/src/import.rs +++ b/vm/src/import.rs @@ -10,7 +10,7 @@ use crate::obj::{objcode, objsequence, objstr}; use crate::pyobject::{ItemProtocol, PyResult, PyValue}; use crate::util; use crate::vm::VirtualMachine; -#[cfg(feature = "rustpython_compiler")] +#[cfg(feature = "rustpython-compiler")] use rustpython_compiler::compile; pub fn init_importlib(vm: &VirtualMachine) -> PyResult { @@ -57,7 +57,7 @@ pub fn import_module(vm: &VirtualMachine, current_path: PathBuf, module_name: &s import_frozen(vm, module_name) } else if vm.stdlib_inits.borrow().contains_key(module_name) { import_builtin(vm, module_name) - } else if cfg!(feature = "rustpython_compiler") { + } else if cfg!(feature = "rustpython-compiler") { let notfound_error = &vm.ctx.exceptions.module_not_found_error; let import_error = &vm.ctx.exceptions.import_error; @@ -79,7 +79,7 @@ pub fn import_module(vm: &VirtualMachine, current_path: PathBuf, module_name: &s } } -#[cfg(feature = "rustpython_compiler")] +#[cfg(feature = "rustpython-compiler")] pub fn import_file( vm: &VirtualMachine, module_name: &str, diff --git a/vm/src/lib.rs b/vm/src/lib.rs index b68276b904..5754d98249 100644 --- a/vm/src/lib.rs +++ b/vm/src/lib.rs @@ -44,7 +44,7 @@ pub mod macros; mod builtins; pub mod cformat; mod dictdatatype; -#[cfg(feature = "rustpython_compiler")] +#[cfg(feature = "rustpython-compiler")] pub mod eval; mod exceptions; pub mod format; diff --git a/vm/src/stdlib/mod.rs b/vm/src/stdlib/mod.rs index 7ce1bed0c8..458a8cfb5e 100644 --- a/vm/src/stdlib/mod.rs +++ b/vm/src/stdlib/mod.rs @@ -1,4 +1,4 @@ -#[cfg(feature = "rustpython_parser")] +#[cfg(feature = "rustpython-parser")] mod ast; mod binascii; mod dis; @@ -6,7 +6,7 @@ mod hashlib; mod imp; mod itertools; mod json; -#[cfg(feature = "rustpython_parser")] +#[cfg(feature = "rustpython-parser")] mod keyword; mod marshal; mod math; @@ -18,7 +18,7 @@ pub mod socket; mod string; mod thread; mod time_module; -#[cfg(feature = "rustpython_parser")] +#[cfg(feature = "rustpython-parser")] mod tokenize; mod unicodedata; mod warnings; @@ -62,7 +62,7 @@ pub fn get_module_inits() -> HashMap { }; // Insert parser related modules: - #[cfg(feature = "rustpython_parser")] + #[cfg(feature = "rustpython-parser")] { modules.insert( "ast".to_string(), diff --git a/vm/src/vm.rs b/vm/src/vm.rs index c6176450e5..bd0beba5ba 100644 --- a/vm/src/vm.rs +++ b/vm/src/vm.rs @@ -36,10 +36,8 @@ use crate::pyobject::{ use crate::stdlib; use crate::sysmodule; use num_bigint::BigInt; -#[cfg(feature = "rustpython_compiler")] -use rustpython_compiler::compile; -#[cfg(feature = "rustpython_compiler")] -use rustpython_compiler::error::CompileError; +#[cfg(feature = "rustpython-compiler")] +use rustpython_compiler::{compile, error::CompileError}; // use objects::objects; @@ -251,7 +249,7 @@ impl VirtualMachine { self.new_exception(overflow_error, msg) } - #[cfg(feature = "rustpython_compiler")] + #[cfg(feature = "rustpython-compiler")] pub fn new_syntax_error(&self, error: &CompileError) -> PyObjectRef { let syntax_error_type = self.ctx.exceptions.syntax_error.clone(); let syntax_error = self.new_exception(syntax_error_type, error.to_string()); @@ -733,7 +731,7 @@ impl VirtualMachine { ) } - #[cfg(feature = "rustpython_compiler")] + #[cfg(feature = "rustpython-compiler")] pub fn compile( &self, source: &str, diff --git a/wasm/lib/Cargo.toml b/wasm/lib/Cargo.toml index 35f02ba8d0..9c78a02904 100644 --- a/wasm/lib/Cargo.toml +++ b/wasm/lib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rustpython_wasm" version = "0.1.0-pre-alpha.2" -authors = ["Ryan Liddle "] +authors = ["RustPython Team"] license = "MIT" description = "A Python-3 (CPython >= 3.5.0) Interpreter written in Rust, compiled to WASM" repository = "https://github.com/RustPython/RustPython/tree/master/wasm/lib" @@ -11,9 +11,9 @@ edition = "2018" crate-type = ["cdylib", "rlib"] [dependencies] -rustpython_compiler = { path = "../../compiler" } -rustpython_parser = { path = "../../parser" } -rustpython_vm = { path = "../../vm" } +rustpython-compiler = { path = "../../compiler" } +rustpython-parser = { path = "../../parser" } +rustpython-vm = { path = "../../vm" } cfg-if = "0.1.2" wasm-bindgen = "0.2" wasm-bindgen-futures = "0.3"