# Which fields are required for a setup.py? Especially, is author required?

**URL:** <https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705>\
**Category:** Packaging\
**Created:** [November 23, 2019, 12:23pm UTC](https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705 "2019-11-23T12:23:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jugmac00](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jugmac00/32/1581_2.png) [@jugmac00](https://discuss.python.org/u/jugmac00)\
**Post date:** [November 23, 2019, 12:23pm UTC](https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705/1 "2019-11-23T12:23:44Z")

</div>

Hi,  
what is the absolute minimum of a setup.py for a package to upload to PyPi?

I could not find a dedicated list.

Background:  
I ported a very old Python package back from 2003 to Python 3 and I’d like to release it on PyPi.

Obviously, now I am the maintainer, but not the author.

I tried to add `author` to setup.py, but then both `python setup.py check` and `pep517` warn me about the missing `author_email` field which I do not know - and most probably the author does not want to get involved in this very old package any more.

```auto
❯ python setup.py check
running check
warning: Check: missing meta-data: if 'author' supplied, 'author_email' must be supplied too

```

All “minimal” setup.py guides on the net list `author` and `author_email` as required.

Is it viable to leave out both author fields?

Thank you!

---

<div class="post-metadata">

**Author:** ![uranusjr](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/uranusjr/32/103_2.png) [@uranusjr](https://discuss.python.org/u/uranusjr)\
**Post date:** [November 23, 2019, 1:16pm UTC](https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705/2 "2019-11-23T13:16:07Z")

</div>

From what I understand, both author and author\_email fields are optional. It’s just Setuptools really wants you to supply one 😛

I believe all fields in setup.py are actually “optional” in the sense that a package can be built successfully without any of them. You at least need a name to upload to PyPI (unless your package is named UNKNOWN which is the default).

---

<div class="post-metadata">

**Author:** ![pf\_moore](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pf_moore/32/35_2.png) [@pf\_moore](https://discuss.python.org/u/pf_moore)\
**Post date:** [November 23, 2019, 6:21pm UTC](https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705/3 "2019-11-23T18:21:04Z")

</div>

Technically, the required fields are defined in [the metadata spec](https://packaging.python.org/specifications/core-metadata/) (`Metadata-Version`, `Name` and `Version`).

Setuptools may have its own rules beyond that, but if so, I don’t know where they are documented.

---

<div class="post-metadata">

**Author:** ![zwol](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/zwol/32/1071_2.png) [@zwol](https://discuss.python.org/u/zwol)\
**Post date:** [November 25, 2019, 2:14pm UTC](https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705/4 "2019-11-25T14:14:15Z")

</div>

To preserve the original author credit and still keep all the tooling happy, you could set `author_email` to a fake address under the [`.invalid` TLD](https://en.wikipedia.org/wiki/.invalid), like this maybe:

```
setup(
    # Original author is no longer involved in development.
    # Their current contact information is unknown.
    author = 'John Dough',
    author_email = 'current.address@unknown.invalid',
    maintainer = 'Jürgen Gmach',
    maintainer_email = 'jugmac00@your.real.email.example',
    # ...
)
```

---

<div class="post-metadata">

**Author:** ![jugmac00](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jugmac00/32/1581_2.png) [@jugmac00](https://discuss.python.org/u/jugmac00)\
**Post date:** [November 25, 2019, 4:07pm UTC](https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705/5 "2019-11-25T16:07:09Z")

</div>

Thank you very much for your answers!

Providing an invalid email address just to please the tooling feels a bit weird, though.

I just created a test package and uploaded it to the test instance of PyPi and it seems `author_email` is not really required - PyPi renders the name of the author nicely.

> **[Products.ZopeTree](https://test.pypi.org/project/Products.ZopeTree/2.0.2.dev0/)**
>
> ZopeTree is a light-weight tree implementation.

I created an issue at pep517’s issue tracker, as in regard to the warning text - if it was a `must` requirement, the build should fail.

> <https://github.com/pypa/pep517/issues/73>
>
> I ported a very old package to Python 3, of which I know the author, but not his email address. Also,...

---

<div class="post-metadata">

**Author:** ![jugmac00](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jugmac00/32/1581_2.png) [@jugmac00](https://discuss.python.org/u/jugmac00)\
**Post date:** [November 26, 2019, 10:30am UTC](https://discuss.python.org/t/which-fields-are-required-for-a-setup-py-especially-is-author-required/2705/6 "2019-11-26T10:30:20Z")

</div>

The misleading warning comes form distutils within cpython.

I created an issue at their bug tracker and a pr:

> <https://github.com/python/cpython/pull/17388>

Cross your fingers! 🙂
