How to generate code based on the variants of an inner enum field?

For example this is what I want to achieve:

// some enum type in other crate actually
enum SomeType {
    Type1,
    Type2,
    Type3,
}

struct Wrapper(SomeType);

#[pyclass]
impl Wrapper {
    #[pystaticmethod]
    fn some_other_functions() {}

    // I want to generate the following functions,
    // one for each variant in SomeType
    #[pystaticmethod]
    fn get_type1() -> Wrapper {
        Wrapper(SomeType::Type1)
    }

    #[pystaticmethod]
    fn get_type2() -> Wrapper {
        Wrapper(SomeType::Type2)
    }

    #[pystaticmethod]
    fn get_type3() -> Wrapper {
        Wrapper(SomeType::Type3)
    }

}

Some ways I have tried:

  1. proc-macro-derive but I have no access to the TokenStream of the enum
  2. build.rs to generate the fn code to some file, then include it in the impl block. Then I got error

non-impl item macro in impl item position: include

  1. use build.rs to generate the whole impl block, this works but it seems hard to add other functions to it if I want (multiple types like this would be implemented, maybe some of them needs additional methods).
  2. have multiple impl blocks with #[pyclass] failed to compile

Haven't tried yet but am thinking of using build.rs to generate the variant info (e.g. Vec<String>) to some const, then with a derive proc-macro to populate the needed fn
Is there any better way here?