Commit Graph

48 Commits

Author SHA1 Message Date
Kyle Gentle
08552c4364 Restructure src dir
Make a few changes in the toplevel src dir to help separate
templates from code. Specifically, we rename `src/mako` to
`src/generator`, and nest the mako templates inside a
`src/generator/templates` dir.

This isolates most Python code into the `src/generator/lib` dir.
2022-08-18 21:23:55 -04:00
Kyle Gentle
5e1c0c857e pyright type checking: Initial setup
* Update imports to use fully qualified module name
* Add `typecheck` target to Makefile
* Add type annotations to appease pyright
* Switch from importlib_resources backport library to stdlib
  import.resources
2022-08-18 21:23:55 -04:00
Kyle Gentle
c5ff239961 feat(Hub): Support custom connectors
Switch the constraints on Hub types to use public traits based on
tower::service, as recommended by Hyper. This enables support for
custom connectors beyond hyper_rustls::HttpsConnector

Closes #337.
2022-06-01 21:12:32 -04:00
Sebastian Thiel
0086b481ea Add previously missed changes, CI will be happy. 2021-04-01 22:12:46 +08:00
Sebastian Thiel
9cff808362 chore(json): update all apis
And bring in 5 new ones, including cloudkms.
Also update dependencies to make things compile again.
2017-05-22 20:42:37 +02:00
Sebastian Thiel
d1ebc0ff0b imp(cli): use hyper-rustls instead of openssl
The only openssl dependency left would be coming from yup-oauth2!
2017-02-01 07:07:05 +01:00
Sebastian Thiel
75316f4c84 chore(version): api-cli lock-step; depend on specific version
As they are usually meant to work hand-in-hand anyway.
This simplifies the way this works a lot, and is probably
more correct as well.
2016-12-24 15:42:39 +01:00
Sebastian Thiel
52a1dd23c1 chore(version): v1.0.1
* cli: now refers to just version 1 of API
* api: updates the documentation URLs in cargo.toml
2016-12-24 15:37:32 +01:00
Sebastian Thiel
5e28a06dc0 fix(versions): cli + api use a single base version
That way we get rid of the duplication at least.
Probably it would be enough to just refer to version 1 of the
library respectively, and let semver do the rest.
2016-12-24 15:23:09 +01:00
Sebastian Thiel
fc34337ee4 doc(lib): use docs.rs for library documentation
We will still need to host the CLI docs though.
2016-12-24 10:35:48 +01:00
Sebastian Thiel
96e07a35da chore(version): keep things stable in v1.0
I think the current API is quite useable, therefore there is
no need to keep it below v1 artificially.
2016-10-16 18:17:13 +02:00
Sebastian Thiel
91a657b8cf feat(cli): can now be published
This works as the API version is now explicitly specified,
allowing cargo-publish to work as usual.
2016-09-11 13:58:32 +02:00
Sebastian Thiel
d2495405c5 chore(Cargo): specify version to allow cli publishing
Let's see if we can actually get away with a '*' ... .
2016-09-11 12:08:57 +02:00
Sebastian Thiel
b6f5fc6eb3 fix(auth): use redirect flow
The interactive flow requires to paste a code back into the
command-line, which does only work when it's cat'ed, but not
if it is pasted.

This should let it handle everything internally, which is
way more user-friendly.
2016-07-17 19:31:13 +02:00
Sebastian Thiel
091d3f7e81 chore(version-up): increment versions ...
... in preparation for new publish.
Latest flows, and all should work out of the box
with the latest serde.
2016-07-17 13:05:00 +02:00
Sebastian Thiel
8d7a49891f chore(dependencies): update to latest version + nightly support
Nightly is now supported, in theory, to allow not to use serde_codegen,
which currently has trouble to build thanks to an assertion error.

Nightly on the other hand suffers from being build with incorrect
feature-flags, which makes quasi_macros fail to build ... .
2016-05-20 15:06:19 +02:00
Sebastian Thiel
930ce6d5c2 chore(update): all jsons; version-up
As we are now back to serde 0.6, the patch-level was upped too.
2016-04-10 14:04:44 +02:00
Sebastian Thiel
5cba22f0c6 chore(versionup): increment versions of API + CLI 2016-01-30 14:07:09 +01:00
Sebastian Thiel
ab1aa55d39 feat(version-up): clap-rs v1.5 -> 2.0 2016-01-30 12:53:02 +01:00
Sebastian Thiel
8295bf3c2d chore(rustup): no wildcards in dependencies
Also version specifications in dependencies were chosen to provide
maximum flexibility for users of the libraries.

CLIs on the other hand specify last known-to-work major and minor versions
to prevent breakage
2015-12-24 15:43:39 +01:00
Sebastian Thiel
8ab4fd0bd4 fix(serde-up): update to serde 0.5.0
Serde move all json code into a separate crate that we are now using
as well.
2015-08-08 10:55:21 +02:00
Sebastian Thiel
be894becc3 fix(clap-up): use clap 1.0.3
* `SubCommand::new(...)` was renamed to `SubCommand::with_name(...)`
  which actually is now consistent with everything else
  (e.g. `Arg::with_name(...)`)
2015-07-15 09:51:01 +02:00
Sebastian Thiel
337f167e6c chore(versionup): CLI v0.3.1 2015-06-26 16:11:42 +02:00
Sebastian Thiel
d6ddff240d chore(version): api+cli increment
CLI was incremented to 0.3.0, just to signal usage of the latest clap-rs
as well as the update of the used API implememtation.

In that moment we also got rid of the json-tools dependency - it
required unstable features, and I was not willing to enforce making
it stable just yet.
2015-06-19 13:25:08 +02:00
Sebastian Thiel
267868cea3 Merge branch 'master' into next 2015-05-18 10:49:24 +02:00
Sebastian Thiel
129fd38e00 imp(CLI): disallow empty values explicitly
[skip ci]
2015-05-18 10:19:38 +02:00
Sebastian Thiel
e434563215 chore(cargo): compilation without local overrides
Also checked in code for groupsmigration to allow others to test it
simply by checking out the right commit.
2015-05-12 17:21:57 +02:00
Sebastian Thiel
3efa4f2b12 fix(API): filter null values of requrest structs
Some servers, like youtube, reject null values possibly thanks to
the reliance on parts. Now we are filtering them (in a very inefficient,
but working way), which seems to be fine with the servers.

Effectively, we seem to be able now to upload videos ... .

More testing required !
2015-05-08 12:38:59 +02:00
Sebastian Thiel
3fe2732a01 fix(compat): upgrade to hyper v0.4.0
It was basically just a find-and-replace to adapt to the changed names
of Error and Result types.
2015-05-08 11:52:28 +02:00
Sebastian Thiel
8375dd0508 chore(CLI): remove special clap configuration
In latest clap, it's all fixed
2015-05-06 21:49:42 +02:00
Sebastian Thiel
294da41a30 chore(CLI): special clap configuration
Turn off default features to disable overly red first version
of otherwise very promising ascii-coloring support.

It's good to see that thanks to yaml, that flexibility is easily
achieved without altering any generator code.
2015-05-06 11:38:40 +02:00
Sebastian Thiel
96415d17ca feat(CLI): did you mean for struct values
* functionality is cursor-aware, and fixes the actual string the user
  passed in. That way, it is made very clear how the suggested value
  is to be used.
* it's a known weakness of the implementation that it operates on a
  flattened list of field names, and thus may make nonsensical
  suggestions.
* added punctuation to all errors

Fixes #67
[skip ci]
2015-05-02 14:07:28 +02:00
Sebastian Thiel
894b5b5ec7 feat(CLI): adjust to serde usage in yup-oauth
* More detailed error type for JsonTokenStorage
* removed all traces of rustc_serialize
* use pretty-printers everywhere to allow writing human-readable json
  files for secretes and for tokens

Fixes #93
2015-04-30 15:20:56 +02:00
Sebastian Thiel
b39bc3a9cd feat(clap): initial version of command generation
It compiles and works, even though there are many things we want to
improve.

One big question is how to define multi-arguments, like -u foo bar baz.
2015-04-28 19:34:24 +02:00
Sebastian Thiel
988d37f0df feat(clap): setup infrastructure
This allows us to setup clap and see if it compiles, which is the prime
goal of the current workflow step.

Related to #81
2015-04-28 16:33:16 +02:00
Sebastian Thiel
4e275eaadd fix(version-up): CLI + API release preps 2015-04-26 11:22:56 +02:00
Sebastian Thiel
159c65916f feat(CLI): --debug flag to output traffix
* If `--debug` is set, we will output all server communication to
  stderr. That way, we can compare our requests to what is expected by
  ush based on official docs.
* `discovery` now doesn't use the API key anymore - this is specified
   using a custom override.

Nice, we are totally ready to test and fix all API features.

Related to #70
2015-04-21 12:03:58 +02:00
Sebastian Thiel
9ea3fea775 fix(rustup): (abf0548b5 2015-04-15) (built 2015-04-15) 2015-04-17 06:46:43 +02:00
Sebastian Thiel
3f49f50ac2 feat(CLI):handle output json encoding and ostreams
* support for encoding response schemas to json
* support for simple downloads (without alt=media)

Fixes #63
2015-04-14 21:57:58 +02:00
Sebastian Thiel
e34e24e049 feat(CLI):required arg parsing + first doit() call
We are parsing required scalar values and handle parse-errors correctly,
to the point were we make a simple, non-upload doit() call.

It shows that we seem to build invalid calls, for now,but that's nothing
we can't fix once the time is ripe.

Next goals will be related to finalizing the argument parsing code.

Fixes #60
2015-04-14 17:17:21 +02:00
Sebastian Thiel
49c4a4101e docs(scopes): added CLI scope documentation
In addition to that, they can now be set as well.
Unified generation of the 'default' scope.
2015-04-12 17:15:55 +02:00
Sebastian Thiel
c78ea5381a feat(mkdocs): cli postprocessing support
That way, a single huge markdown file containing documentation for
commands and methods can be split up into multiple files for
individual inclusion in mkdocs.

It's done by a post-processor which is loaded by mako-render, providing
access to the entire context. Said processor may also drop results
altogether and thus prevent files to be written that have been split up
by it.
2015-04-10 13:02:36 +02:00
Sebastian Thiel
f527c8202b feat(cli): bin renaming + docopt infrastructure
* allow to rename executables, for now just brute-force using a boolean
  flag. If we have more binaries at some point, we might want to be more
  elaborate.
* everything related to docopts functionality is now in the docopts
  module.

  Related to #45
2015-04-09 17:05:55 +02:00
Sebastian Thiel
390354bd08 feat(cli): basic usage of docopts
For now we just show it works within our generator.
Next step is to actually generate docopts grammar.
2015-04-09 16:28:08 +02:00
Sebastian Thiel
d1c97912cb feat(mkdocs): mkdocs generator works now
It can be selected for each type of program we want to build, and makes
sense for everything that is not a library.

We also tried to unify names and folders a bit more, even though there
certainly is more work to be done to be fully non-redundant.

Fixes #43
2015-03-24 18:11:12 +01:00
Sebastian Thiel
cefd606b53 feat(make): cli depends on API, generically
This allows us to build efficiently. CLI programs can now have their
own cmn.rs implementation, which we can test standalone with
`cargo test`.

The primary makefile currently just explicitly pulls in the type-*.yaml,
one day we could possibly put it into a loop.

Fixes #11
2015-03-24 12:56:24 +01:00
Sebastian Thiel
caaf62e51d chore(suffix):prepare dep generation to use suffix
That way, we can have multiple deps files, one per program 'type'
2015-03-24 11:57:12 +01:00
Sebastian Thiel
be7d8214c1 feat(api): api generation works once again
With the new structure, it should be easy to add CLI programs with
proper dependencies accordingly.
2015-03-24 09:38:14 +01:00