CI: Fix npdev build post Cython annotation change
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Appears the new build failure was due to https://github.com/cython/cython/issues/4885

Major changes:

1. `Period._from_ordinal` is annotated `def _from_ordinal(oridinal: int, freq)` which now strictly only accepts Python ints. Need to change to `def _from_ordinal(oridinal: int64_t, freq)`

cc @jbrockmendel could use your insight into another failure.

e.g. `np.repeat(EA, 2)` is returning an ndarray instead of an EA. What code path would that go through? > Period._from_ordinal is annotated def _from_ordinal(oridinal: int, freq), so ordinal needs to always be a Python int and not a np.int64

We end up casting to int64_t, so this casting feels wasteful.  Could we just make the annotation int64_t? > e.g. np.repeat(EA, 2) is returning an ndarray instead of an EA. What code path would that go through?

np.repeat [uses](https://github.com/numpy/numpy/blob/v1.23.0/numpy/core/fromnumeric.py#L436) array_function_dispatch, which I think means it checks for `__array_function__`, which we don't implement anywhere.  Without `__array_function__`, it isn't that surprising that it returns an ndarray.  If anything I'm surprised it used to (?).
 Found it:

We define `def repeat(self, repeats, axis: int = 0)` which `np.repeat` dispatches to

https://github.com/numpy/numpy/blob/54c52f13713f3d21795926ca4dbb27e16fada171/numpy/core/fromnumeric.py#L52-L66=

Since axis can be a `np.int64` it hit's numpy's `except TypeError` block which probably caused the different behavior.

Looks like we need to be careful with annotating cython code with Python types as they will be strict now and raise a `TypeError` otherwise. > Since axis can be a np.int64 it hit's numpy's except TypeError block which probably caused the different behavior

Sure its int64 and not intp? > > Since axis can be a np.int64 it hit's numpy's except TypeError block which probably caused the different behavior
> 
> Sure its int64 and not intp?

Hmm good point. `intp` is probably safer here I decided to remove the `: int` annotation for `repeat(..., axis: int)`. `intp_t` was failing in cython 0.29.x. We can revist the tying in a followup > Since axis can be a np.int64 it hit's numpy's except TypeError block which probably caused the different behavior.

Thanks @mroeschke for finding this ! I can stop investigating in #46405 :) Np @smarie, sorry I didn't realized you were investigating it in tandem.

Does it look okay to you @jbrockmendel?   no objections Merging to get the CI to green. Can followup if needed