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

Stil parser updates premerge #200

Closed
wants to merge 215 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
83038d6
Massive undergoing for command integration and the global invocation.
coreyeng Dec 27, 2022
e82fd31
Fix to see if regressions will work.
coreyeng Dec 28, 2022
49d2c67
Realized settrue arg action sets a default.
coreyeng Dec 28, 2022
d918357
Add no-app unit tests
coreyeng Dec 28, 2022
0fcd539
Use poetry directly in no-app tests
coreyeng Dec 28, 2022
130ccf8
More tries at no-app tests
coreyeng Dec 28, 2022
fe10d11
Try updated lockfile
coreyeng Dec 28, 2022
87f2c58
Updates for Linux/Python 3.8-
Dec 30, 2022
d945b0e
regression debug
coreyeng Dec 30, 2022
f7bce36
regressions debug
coreyeng Dec 30, 2022
a3298eb
Attempt python 3.7 fix. Some minor cleanup.
Dec 31, 2022
67cbe8f
Merge remote-tracking branch 'refs/remotes/origin/metal_integration' …
Dec 31, 2022
2d25f5e
Add user setting to disable password prompt. Add some simple tests. M…
Dec 31, 2022
a383344
Some clean up and refactoring
Jan 1, 2023
84da497
Add core_app. Continued clean up.
Jan 3, 2023
6f10098
Fix reserved windows path.
Jan 3, 2023
143aed9
Continue cleanup and add more tests.
Jan 17, 2023
0fc4efa
Add support for target, no target, and mode opts for custom commands …
Jan 29, 2023
fc6d23e
Merge remote-tracking branch 'origin/master' into metal_integration
Jan 29, 2023
cb957ae
use target command as guinea pig for a non-frontend command. Add stru…
Feb 13, 2023
66264f1
Make 'all targets' deterministic. Remove some debug statements. Add a…
Feb 13, 2023
5543e54
Allow assert present to receive str or list of strs.
Feb 13, 2023
716cc7d
Support app opts i n plugin/aux commands. Support disabling. Add test…
Feb 16, 2023
5a51c3b
Forgot a file
Feb 16, 2023
208bb22
Handle inter and intra opt exts. Add many tests but still some placeh…
Mar 30, 2023
91b8cb2
Prototype non-extendable commands. Redo boot sequence for more consis…
Apr 26, 2023
904c0bf
debug regression fails
Apr 26, 2023
7ec5593
continue regression debug
Apr 27, 2023
4a8df7d
Refactor and update non-extendable for plugins/plugin/aux_cmds/app-co…
May 11, 2023
a813bf9
See if updating locks and rust version resolves plugin order checking.
May 11, 2023
691461d
Remove checking order from app plugins. Doesn't seem to match between…
May 12, 2023
9785118
Merge remote-tracking branch 'origin/master' into metal_integration
May 12, 2023
723221e
Move generate and env commands to use shared methods. Add some basic …
May 16, 2023
f4d411e
add cargo.lock from merge
May 16, 2023
dfe3dbf
Attempt to fix windows regressions.
May 16, 2023
e9b81bc
Fix for windows
coreyeng May 17, 2023
4eb0c26
Start cleanup and remove untested commands
May 18, 2023
8615871
Refactor build/fmt as develop_origen subcmds. Update regressions acco…
May 19, 2023
617e114
Clean up last of CLI warnings. Remove app commands that haven't been …
May 20, 2023
b5c3084
Some cleanup & support splitting out core cmds from boot.py
May 22, 2023
d286688
Continue clean up. Bugfix where parent required args are inherited by…
May 24, 2023
ef489a1
Continue cleanup items
May 26, 2023
19a4625
Continue cmds PR cleanup and additional tests
May 29, 2023
1b06a8d
Try to fix path difference on Windows regressions.
coreyeng May 29, 2023
f2262ba
Continue cleanup or dispositining tasks
Jun 1, 2023
aff9521
Continue cleanup & re-categorizing future TODOs/tests
Jun 4, 2023
ee67a10
Finish up recategorizing cleanup items
Jun 4, 2023
fac50eb
Merge pull request #190 from Origen-SDK/metal_integration
coreyeng Jun 11, 2023
d4d9225
Begin invocation debug/test work. Add infrastructure and some tests f…
Jun 24, 2023
1dcce4c
Add missing checkin
Jun 24, 2023
ae15f17
Debugging regressions
Jun 25, 2023
03f2d35
Add jinja2 install
Jun 25, 2023
17e26e6
Fix pip install in actions yml
Jun 25, 2023
8700aeb
Try re-lock of user install invocation.
Jun 25, 2023
2794bd2
Debug tests on GA
Jun 25, 2023
2e0bbc1
(GA) Remove poetry update before OM tests
Jun 25, 2023
cffef7c
GA debug - unordered PL compare
Jun 26, 2023
6f0b72a
Add pytest rewrite for t_invocation_env in no_workspace
Jun 26, 2023
6e6f8b6
(GA Debug) Local env. was stale.
Jun 26, 2023
5213de7
Have eval cmd support running from script files.
Jul 1, 2023
6784940
Set indices to empty-dict if not given. Add test for arg indices. Fix…
Jul 2, 2023
c4d6287
Support auto-interpreting some args as strs in run_cli_cmd
Jul 2, 2023
69242fa
Fix for windows path conversion with given as arg to run_cli_cmd
coreyeng Jul 3, 2023
a9200fb
Accidentally left in some debug stuff
coreyeng Jul 3, 2023
62cabad
Add no-workspace with/without plugins tests
Jul 4, 2023
8889c54
Debug regression tests
Jul 4, 2023
55c8b27
GA: fix multiple run steps
Jul 4, 2023
2dcfcdb
GA: More debug
Jul 4, 2023
8c47254
GA: More debug
Jul 4, 2023
013db4f
GA: More debug
Jul 4, 2023
0f16b7f
GA: Continued Debug
Jul 5, 2023
22c7f7c
Update from cli-loc to cli-dir in invocation tests
Jul 5, 2023
ba98475
GA: Continued Debug
Jul 5, 2023
2a1f0e1
GA: Continued Debug
Jul 5, 2023
1026840
GA: Continued Debug
Jul 5, 2023
be43620
GA: Continued Debug
Jul 5, 2023
9c57296
GA: Continued Debug
Jul 5, 2023
d5dcdb3
Add global workspace tests
Jul 6, 2023
ff92557
Merge remote-tracking branch 'origin/master' into invocations
Jul 6, 2023
716ce8c
GA: Continued Debug
Jul 6, 2023
62b82b7
GA: Continued Debug
Jul 7, 2023
34051fe
GA: Continued Debug
Jul 7, 2023
a4a95a5
GA: Continued Debug
Jul 7, 2023
2509ae4
GA: Continued Debug
Jul 7, 2023
2685b45
GA: Continued Debug
Jul 7, 2023
3c6e385
GA: Continued Debug
Jul 7, 2023
dd92cf8
Continued GA Debug
Jul 8, 2023
8d885d3
GA: Continued Debug
Jul 8, 2023
d1c471d
GA: Continued Debug
Jul 8, 2023
d54344e
Some cleanup and add some context for Windows issue in GA
Jul 8, 2023
989d4e1
Minor cleanup
Jul 9, 2023
5fd1692
Add some error cases that may fall back to a global install
Jul 11, 2023
8664443
GA: Debug
Jul 11, 2023
97b369c
GA: Debug
Jul 11, 2023
5fec106
GA: Debug
Jul 11, 2023
a6fd4b0
See about moving Python version to repo variable
Jul 12, 2023
1b0bc2d
Move more into repo variables
Jul 12, 2023
367ec1a
Try new rust install as current one causes deprecation warnings and a…
Jul 12, 2023
3658eb4
GA: Debug New Rust Setup
Jul 12, 2023
70369bd
GA: Debug & Update checkout version
Jul 13, 2023
313fe40
Merge pull request #191 from Origen-SDK/invocations
coreyeng Jul 15, 2023
cb28b99
Update to pyo3 17.3
Jul 16, 2023
4798684
Clean up pyo3 17.3 warnings. Fix run_cmd calls in examples
Jul 17, 2023
6055900
Bump to pyo3 18.0
Jul 19, 2023
76aee8b
Update to pyo3 19.1 (latest as of now)
Jul 19, 2023
de5364b
Update pyprojects to support up to 3.12. add script to make this easi…
Jul 24, 2023
000eb66
Try bumping pip version for python 3.12
Jul 25, 2023
bde62f0
GA: Test for for python 3.12
Jul 25, 2023
cda1eaf
Merge remote-tracking branch 'origin/master' into python_3.11_support
Jul 26, 2023
8520c30
Merge pull request #192 from Origen-SDK/python_3.11_support
coreyeng Jul 26, 2023
6e97944
Support later rust
Aug 2, 2023
8cabadd
Support stable rust
coreyeng Aug 5, 2023
2ffa013
Merge pull request #193 from Origen-SDK/rust_update
coreyeng Aug 9, 2023
e897f1f
Support generating a new workspace (not full app, just workspace). So…
Oct 18, 2023
0973471
Attempt: Fix regression tests
coreyeng Oct 20, 2023
e4b0e6a
Support workflow dispatch for regressions
coreyeng Oct 21, 2023
be773b7
Add readme for no-workspace regressions
coreyeng Oct 22, 2023
6f852de
Update README.md
coreyeng Oct 22, 2023
02bdfd3
Merge pull request #195 from Origen-SDK/origen_new
coreyeng Oct 22, 2023
25021b8
WIP: publish action
Nov 4, 2023
763abef
(origen/OM publishing) Add check for when full publishing script shou…
Nov 5, 2023
ebc3dd8
WiP: publishing
Nov 5, 2023
910636c
WiP: publishing
Nov 5, 2023
ad9e0e4
WiP: publishing
Nov 5, 2023
14e9b2c
WiP: publishing
Nov 6, 2023
fbb26b0
WiP: publishing
Nov 6, 2023
698ef93
Robustness/usage fixes for 'run_origen' poetry wrapper
Nov 7, 2023
4b84cd7
Debug: Robustness/usage fixes for 'run_origen' poetry wrapper
coreyeng Nov 7, 2023
bed413e
Debug: Robustness/usage fixes for 'run_origen' poetry wrapper
coreyeng Nov 8, 2023
17f0dca
Debug: Try reverting run cmd for Linux.
coreyeng Nov 8, 2023
38d10a7
Try removing _origen copy step
coreyeng Nov 9, 2023
4eb3782
Add copy step back. Slight reorder of no-app check to after CLI manip…
coreyeng Nov 9, 2023
0def459
Retry robustness update in run_origen
coreyeng Nov 9, 2023
dc4ba22
Try using poetry's wrapper for regressions.
coreyeng Nov 9, 2023
fd621b9
Copy origen binary, imitating full build step
coreyeng Nov 9, 2023
a831575
Update CLI dirs.
coreyeng Nov 12, 2023
9af9274
Try moving origen CLI earlier
coreyeng Nov 12, 2023
1585119
Move user install tests to after global origen install
coreyeng Nov 13, 2023
c458a1a
Regressions debug
coreyeng Nov 13, 2023
6e5bbfc
Regressions debug
coreyeng Nov 13, 2023
ff8907b
WiP: Github release during publish
Nov 13, 2023
c6cacf8
Merge remote-tracking branch 'origin/master'
Nov 13, 2023
e165ee2
Fix GH release condition
Nov 13, 2023
9eef87f
Try adding a checkout to see if the github release action picks up gi…
Nov 13, 2023
b41ca4c
Try adding commit to release
Nov 13, 2023
6078384
Try adding commit-based tag.
Nov 14, 2023
c9f05d7
WiP: Publish GH Release
Nov 14, 2023
85b7fbd
WiP: GH Release. Zip wheels for release upload.
Nov 14, 2023
7418339
Add commit preface to tag. Bump upload artifact version
Nov 15, 2023
14a1254
Clean up dead code in regressions. Run metal tests across python vers…
coreyeng Nov 15, 2023
9ef28f8
Fix commit tag during GH release. Add boolean options
Nov 15, 2023
a5c12be
Merge pull request #196 from Origen-SDK/cli_and_tests_debug
coreyeng Nov 15, 2023
eef3d78
Prototype using 'retry' action for finicky steps
coreyeng Nov 15, 2023
330b709
WiP: Start larger publishing effort
Nov 17, 2023
586b042
Merge remote-tracking branch 'origin/master'
Nov 17, 2023
581515e
Publishing: bugfix in GH release. Try not validating wheel metadata
Nov 18, 2023
96210d2
Publishing: Debug action
Nov 18, 2023
dc9b5f3
Publishing: Try just releasing origen to test server. Debug getting i…
Nov 18, 2023
f768b78
Publishing: WiP
Nov 18, 2023
0c442fa
WiP O2 Publishing: Bump git2 version. Support getting/increment versi…
Dec 9, 2023
35bcaab
Support any Python 3.12 version
Dec 10, 2023
323344e
Update python versions again. Change script to non-inclusive max.
Dec 10, 2023
e4db777
Update lock file for new python
Dec 10, 2023
c64eca1
Resume WiP on publishing action
Dec 10, 2023
8ea05f1
Add OM test server publishing token
Dec 10, 2023
318c370
WiP: Debug publishing
Dec 10, 2023
a49061e
WiP: Publishing: Bugfix for GH release
Dec 10, 2023
b40239b
WiP: PublishingO2: Bump OM/Origen versions. Some scripting to assist …
Dec 11, 2023
9536b90
WiP: Publishing: Add pypi job. Add verbose setting to pypi uploads
Dec 11, 2023
1c45418
WiP: Publishing: Ensure cleanup after release to pypi
Dec 11, 2023
03e4a36
WiP: Publishing: Fix some typos
Dec 11, 2023
2ecb0a8
Experiment with publish checks in publish action
Jan 9, 2024
15b3f10
WiP: Publishing Checks
Jan 10, 2024
6eb2c4e
WiP: Publishing Checks
Jan 10, 2024
af6ad8a
WiP: Publishing Checks: Try updating lock_master job permissions.
Jan 11, 2024
8c2eb0f
WiP: Publishing: Experiment with Docker image for manylinux
Jan 13, 2024
489d2c5
WiP: Publishing Manylinux
Jan 13, 2024
a406070
WiP: Publishing Manylinux
Jan 13, 2024
a2df131
WiP: Publishing Manylinux
Jan 13, 2024
5500ecb
WiP: Publishing, try manylinux2014 image
Jan 13, 2024
66ddea8
WiP: Publishing: Momentarily skip Rust install
Jan 13, 2024
701a1e5
WiP: Publishing: Actually try rust skip
Jan 13, 2024
e4bab83
WiP: Publishing: manylinux
Jan 16, 2024
78fb3a8
WiP: Publishing: manylinux
Jan 17, 2024
56fcb19
WiP: Publishing: manylinux
Jan 17, 2024
8199c5c
WiP: Publishing manylinux
Jan 20, 2024
f6f4bf7
WiP: Publishing. Revert windows release to same versions as regressio…
Jan 20, 2024
621fba4
WiP: Publishing manylinux. Bugfix for python URL
Jan 20, 2024
852310f
WiP: Publishing manylinux
Jan 21, 2024
e4ea98f
WiP: Publishing manylinux
Jan 21, 2024
81f6c82
WiP: Publishing manylinux
Jan 21, 2024
96c916e
WiP: Publishing manylinux
Jan 21, 2024
ed98e7e
WiP: Publishing manylinux
Jan 21, 2024
578f3f1
WiP: Publishing manylinux
Jan 21, 2024
243bded
Move version wrapper to OM. Add some version tests. Support version f…
Feb 1, 2024
44f1db9
Debug regressions
Feb 2, 2024
be52e43
Add equivalent origen version support from OM. Bump origen version to…
Feb 6, 2024
aa81da3
Bump Origen version. Add consistency to user-facing versions. Change …
Feb 15, 2024
9c694c7
Try reinstalling poetry globally for windows regressions
Feb 17, 2024
40f85ce
Fix Cargo.toml capitalization
coreyeng Feb 17, 2024
1993564
Add additional poetry/pip version outputs. Try poetry install from ENV.
Feb 17, 2024
f5582f6
Merge remote-tracking branch 'origin/master'
Feb 17, 2024
3df6dd0
Fix caching poetry version
Feb 17, 2024
f0c671c
WIP: Debug Regressions
Feb 18, 2024
ad5e173
Debug Regressions: Try reverting build system
Feb 18, 2024
07a2f49
Add CLI to github releases. Bypass regressions for just version and p…
Mar 3, 2024
4d02b4a
Try to fix regression test paths-ignore error
Mar 5, 2024
ea36b3f
Try to fix regression test ignore-paths
Mar 5, 2024
f2cbc9f
Build out publish command some. Remove locking master from publish wo…
Mar 11, 2024
b647ef1
Updated version files for next release
Mar 17, 2024
600cc85
Continue work on publish command.
Mar 17, 2024
f24848b
Try regression fix. Add additional version support. Add some version …
Mar 18, 2024
5c321a6
Expose some more version features to frontend. Add tests.
Mar 19, 2024
de4bd47
Fix OM test needing FE for less-robust Windows
Mar 19, 2024
b17488b
Attempt merge from master
rlaj May 28, 2024
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
Prev Previous commit
Next Next commit
Refactor build/fmt as develop_origen subcmds. Update regressions acco…
…rdingly.
  • Loading branch information
Corey committed May 19, 2023

Verified

This commit was signed with the committer’s verified signature.
mikaelbr Mikael Brevik
commit 8615871600892fa7f4df86d8f11c7d30b4b220b7
4 changes: 2 additions & 2 deletions .github/workflows/regression_test.yml
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ jobs:
run: origen -v

- name: Build PyAPI
run: origen build
run: origen origen build

- name: Setup App Env
working-directory: test_apps/python_app
@@ -119,7 +119,7 @@ jobs:
run: cargo test --workspace

- name: Build PyAPI - Metal
run: origen build --metal
run: origen origen build --metal

- name: Install Poetry
uses: abatilo/actions-poetry@v2.0.0
2 changes: 0 additions & 2 deletions python/origen/origen/helpers/regressions/cli/origen.py
Original file line number Diff line number Diff line change
@@ -334,8 +334,6 @@ def targets_arg(cls, help):
extendable=False,
)
aux_cmds = _CommonNames.aux_cmds_cmd()
# build = Cmd(names.build)
# compile = Cmd(names.compile)
creds = _CommonNames.creds_cmd(add_opts=in_app_opts.all())
env = Cmd(
names.env,
32 changes: 8 additions & 24 deletions rust/origen/cli/src/bin.rs
Original file line number Diff line number Diff line change
@@ -429,6 +429,10 @@ fn main() -> Result<()> {
commands::target::add_helps(&mut helps);
}

if STATUS.is_origen_present {
commands::develop_origen::add_helps(&mut helps);
}

helps.apply_exts(&extensions);

/************************************************************************************/
@@ -447,28 +451,9 @@ fn main() -> Result<()> {
/************************************************************************************/
/******************** Origen dev commands *******************************************/
/************************************************************************************/
// if STATUS.is_origen_present || STATUS.is_app_present {
// let fmt_help = match STATUS.is_origen_present {
// true => "Nicely format all Rust and Python files",
// false => "Nicely format all of your application's Python files",
// };

// origen_commands.push(CommandHelp {
// name: "fmt".to_string(),
// help: fmt_help.to_string(),
// shortcut: None,
// });

// app = app
// //************************************************************************************/
// .subcommand(Command::new("fmt").about(fmt_help));
// }

// if STATUS.is_origen_present || STATUS.is_app_in_origen_dev_mode {
// let (app_, help) = commands::build::define(app);
// app = app_;
// origen_commands.push(help);
// }
if STATUS.is_origen_present {
app = commands::develop_origen::add_commands(app, &helps, &extensions)?;
}

/************************************************************************************/
/******************** In application commands ***************************************/
@@ -1035,12 +1020,11 @@ fn main() -> Result<()> {

match matches.subcommand_name() {
Some(commands::app::BASE_CMD) => commands::app::run(matches.subcommand_matches(commands::app::BASE_CMD).unwrap(), &app, &extensions, plugins.as_ref(), &app_cmds.as_ref().unwrap())?,
// Some("fmt") => commands::fmt::run()?,
// Some("new") => commands::new::run(matches.subcommand_matches("new").unwrap()),
// Some("build") => commands::build::run(matches.subcommand_matches("build").unwrap())?,
// Some("proj") => commands::proj::run(matches.subcommand_matches("proj").unwrap()),
Some(commands::env::BASE_CMD) => run_non_ext_cmd_match_case!(env),
Some(commands::eval::BASE_CMD) => run_cmd_match_case!(eval),
Some(commands::develop_origen::BASE_CMD) => run_non_ext_cmd_match_case!(develop_origen),
Some(commands::interactive::BASE_CMD) => run_cmd_match_case!(interactive),
Some(commands::aux_cmds::BASE_CMD) => commands::aux_cmds::run(matches.subcommand_matches(commands::aux_cmds::BASE_CMD).unwrap(), &app, &extensions, plugins.as_ref(), &aux_cmds)?,
Some(commands::generate::BASE_CMD) => run_cmd_match_case!(generate),
3 changes: 2 additions & 1 deletion rust/origen/cli/src/commands/_prelude/mod.rs
Original file line number Diff line number Diff line change
@@ -6,8 +6,9 @@ pub use indexmap::IndexMap;
pub use super::{launch, launch_simple, launch_as};
pub use crate::framework::{
Extensions, Plugins, add_verbosity_opts,
CmdHelps, CmdHelp, CmdSrc
CmdHelps, CmdHelp, CmdSrc,
};
pub use crate::framework::core_cmds::SubCmd;
pub use crate::{output_dir_opt, ref_dir_opt};

// FOR_PR remove this
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::CommandHelp;
use clap::{App, Arg, ArgMatches};
use clap::Command as ClapCommand;
use origen::core::file_handler::File;
use origen::utility::version::Version;
use origen::{Result, STATUS};
@@ -10,55 +8,49 @@ use regex::Regex;
use sha2::{Digest, Sha256};
use std::path::Path;
use std::process::Command;
use super::_prelude::clap_arg_actions::*;

pub fn define<'a>(app: App<'a>) -> (App<'a>, CommandHelp) {
let help = match STATUS.is_origen_present {
true => "Build and publish Origen, builds the pyapi Rust package by default",
false => "Build Origen",
};

let mut cmd = ClapCommand::new("build").about(help).arg(
Arg::new("cli")
.long("cli")
.required(false)
.action(SetArgTrue)
.display_order(1)
.help("Build the CLI (instead of the Python API)"),
);

if STATUS.is_origen_present {
cmd = cmd

use crate::commands::_prelude::*;
pub const BASE_CMD: &'static str = "build";

pub (crate) fn build_cmd<'a>() -> SubCmd<'a> {
core_subcmd__no_exts__no_app_opts!(
BASE_CMD,
"Build and publish Origen, builds the pyapi Rust package by default",
{ |mut cmd: App| {
cmd.visible_alias("b")
.arg(
Arg::new("cli")
.long("cli")
.required(false)
.action(SetArgTrue)
.help("Build the CLI (instead of the Python API)"),
)
.arg(
Arg::new("release")
.long("release")
.required(false)
.action(SetArgTrue)
.display_order(1)
.help("Build a release version (applied by default with --publish and only applicable to Rust builds)"),
)
.arg(
Arg::new("target")
.long("target")
.required(false)
.action(SetArg)
.display_order(1)
.help("The Rust h/ware target (passed directly to Cargo build)"),
)
.arg(
Arg::new("publish")
.long("publish")
.required(false)
.action(SetArgTrue)
.display_order(1)
.help("Publish packages (e.g. to PyPI) after building"),
)
.arg(
Arg::new("dry_run")
.long("dry-run")
.required(false)
.action(SetArgTrue)
.display_order(1)
.help("Use with --publish to perform a full dry run of the publishable build without actually publishing it"),
)
.arg(
@@ -67,29 +59,20 @@ pub fn define<'a>(app: App<'a>) -> (App<'a>, CommandHelp) {
.required(false)
.action(SetArg)
.value_name("VERSION")
.display_order(1)
.help("Set the version (of all components) to the given value"),
)
.arg(
Arg::new("metal")
.long("metal")
.action(SetArgTrue)
.display_order(1)
.help("Build the metal_pyapi"),
);
}

let help = CommandHelp {
name: "build".to_string(),
help: help.to_string(),
shortcut: None,
};

(app.subcommand(cmd), help)
)
}}
)
}

pub fn run(matches: &ArgMatches) -> Result<()> {
if let Some(v) = matches.get_one::<&str>("version") {
pub(crate) fn run(mut invocation: &clap::ArgMatches) -> Result<()> {
if let Some(v) = invocation.get_one::<&str>("version") {
let mut version_bad = false;
let version;
match Version::new_semver(v) {
@@ -150,15 +133,15 @@ pub fn run(matches: &ArgMatches) -> Result<()> {

// Build the latest CLI, this can be requested from an Origen workspace or an app workspace that is
// locally referencing an Origen workspace
if *matches.get_one("cli").unwrap() {
if *invocation.get_one("cli").unwrap() {
cd(&STATUS
.origen_wksp_root
.join("rust")
.join("origen")
.join("cli"))?;
display!("");
let mut args = vec!["build"];
if *matches.get_one("release").unwrap() || *matches.get_one("publish").unwrap() {
if *invocation.get_one("release").unwrap() || *invocation.get_one("publish").unwrap() {
args.push("--release");
}
Command::new("cargo")
@@ -168,13 +151,13 @@ pub fn run(matches: &ArgMatches) -> Result<()> {
display!("");

// Build the metal_pyapi
} else if *matches.get_one("metal").unwrap() {
build_metal(matches)?;
} else if *invocation.get_one("metal").unwrap() {
build_metal(invocation)?;
// Build the PyAPI by default
} else {
// A publish build will also build the origen_pyapi Python package and
// publish it to PyPI, only available within an Origen workspace
if *matches.get_one("publish").unwrap() {
if *invocation.get_one("publish").unwrap() {
let wheel_dir = &STATUS
.origen_wksp_root
.join("rust")
@@ -214,7 +197,7 @@ pub fn run(matches: &ArgMatches) -> Result<()> {
change_pyapi_wheel_version(&wheel_dir, &old, &new);
}

if *matches.get_one("publish").unwrap() && !matches.get_one::<bool>("dry_run").unwrap() {
if *invocation.get_one("publish").unwrap() && !invocation.get_one::<bool>("dry_run").unwrap() {
let pypi_token =
std::env::var("ORIGEN_PYPI_TOKEN").expect("ORIGEN_PYPI_TOKEN is not defined");

@@ -239,7 +222,7 @@ pub fn run(matches: &ArgMatches) -> Result<()> {
// A standard (non-published) build, this can be requested from an Origen workspace or an app workspace that
// is locally referencing an Origen workspace
} else {
build_metal(matches)?;
build_metal(invocation)?;
let pyapi_dir = STATUS.origen_wksp_root.join("rust").join("pyapi");
cd(&pyapi_dir)?;
display!("");
@@ -248,11 +231,11 @@ pub fn run(matches: &ArgMatches) -> Result<()> {
let mut target = "debug";
let mut arch_target = None;

if *matches.get_one("release").unwrap() {
if *invocation.get_one("release").unwrap() {
args.push("--release");
target = "release";
}
if let Some(t) = matches.get_one::<&str>("target") {
if let Some(t) = invocation.get_one::<&str>("target") {
args.push("--target");
args.push(t);
arch_target = Some(t);
@@ -313,19 +296,19 @@ pub fn run(matches: &ArgMatches) -> Result<()> {
Ok(())
}

fn build_metal(matches: &ArgMatches) -> Result<()> {
fn build_metal(invocation: &ArgMatches) -> Result<()> {
let pyapi_dir = &STATUS.origen_wksp_root.join("rust").join("pyapi_metal");
cd(&pyapi_dir)?;

let mut args = vec!["build"];
let mut target = "debug";
let mut arch_target = None;

if *matches.get_one("release").unwrap() {
if *invocation.get_one("release").unwrap() {
args.push("--release");
target = "release";
}
if let Some(t) = matches.get_one::<&str>("target") {
if let Some(t) = invocation.get_one::<&str>("target") {
args.push("--target");
args.push(t);
arch_target = Some(t);
Original file line number Diff line number Diff line change
@@ -9,7 +9,18 @@ use std::io::Write;
use std::path::Path;
use std::process::Command;

pub fn run() -> Result<()> {
use crate::commands::_prelude::*;
pub const BASE_CMD: &'static str = "fmt";

pub (crate) fn fmt_cmd<'a>() -> SubCmd<'a> {
core_subcmd__no_exts__no_app_opts!(
BASE_CMD,
"Nicely format all Rust and Python files",
{ |cmd| { cmd } }
)
}

pub(crate) fn run() -> Result<()> {
let orig_dir = env::current_dir().expect("Couldn't read the PWD");

if STATUS.is_origen_present {
25 changes: 25 additions & 0 deletions rust/origen/cli/src/commands/develop_origen/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
mod build;
mod fmt;

use origen::Result;
use super::_prelude::*;
pub const BASE_CMD: &'static str = "develop_origen";

gen_core_cmd_funcs__no_exts__no_app_opts!(
BASE_CMD,
"Commands to assist with Origen core development",
{ |cmd: App<'a>| {
cmd.arg_required_else_help(true).visible_alias("origen")
}},
build::build_cmd(),
fmt::fmt_cmd()
);

pub(crate) fn run(mut invocation: &clap::ArgMatches) -> Result<()> {
let (n, subcmd) = invocation.subcommand().unwrap();
match n {
build::BASE_CMD => build::run(subcmd),
fmt::BASE_CMD => fmt::run(),
_ => unreachable_invalid_subc!(n)
}
}
2 changes: 1 addition & 1 deletion rust/origen/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// FOR_PR clean up, specifically launch stuff
pub mod app;
// pub mod build;
pub mod env;
pub mod exec;
// pub mod fmt;
@@ -12,6 +11,7 @@ pub mod interactive;
pub mod target;
// pub mod mailer;
pub mod credentials;
pub mod develop_origen;
pub mod generate;
pub mod eval;
pub mod aux_cmds;
Original file line number Diff line number Diff line change
@@ -10,6 +10,25 @@

from .asertions import AssertionHelpers

develop_origen = "develop_origen"
def develop_origen_cmd():
return Cmd(
develop_origen,
help="Commands to assist with Origen core development",
aliases=["origen"],
subcmds=[
Cmd("build"),
]
)

cli.GlobalCommands.Names.develop_origen = develop_origen
cli.GlobalCommands.develop_origen = develop_origen_cmd()
cli.GlobalCommands.commands.insert(2, cli.GlobalCommands.develop_origen)

cli.InAppCommands.Names.develop_origen = develop_origen
cli.InAppCommands.develop_origen = develop_origen_cmd()
cli.InAppCommands.commands.insert(4, cli.InAppCommands.develop_origen)

def apply_ext_output_args(mod):
from origen.boot import before_cmd, after_cmd, clean_up
from .ext_helpers import do_action