Python plugin problem with distribution

Problem:

When I upload my package and create distribution. Distribution returns unusable base_url

“base_url”: “https://d18954d39a00/pypi/tartarus/master/

Expected outcome:

it should return https://pulp.ozoli.lv/pypi/tartarus/master/

Pulpcore version:

Pulp docker image pulp/pulp:latest

Pulp plugins installed and their versions:

Default which came with docker image

Operating system - distribution and version:

Linux

Other relevant data:
I use pulp docker image and my settings.py file is like this
#I can’t write https:// at start because new users can post only 2 links :slight_smile:
CONTENT_ORIGIN=‘pulp.ozoli.lv’
ANSIBLE_API_HOSTNAME=‘pulp.ozoli.lv’
ANSIBLE_CONTENT_HOSTNAME=‘pulp.ozoli.lv/pulp/content’
TOKEN_AUTH_DISABLED=True

Hey @Imants_Gulbis,

The distribution base_url uses the setting PYPI_API_HOSTNAME to form the url similar to how the Ansible plugin works. By default the setting uses socket.getfqdn() which returns an unusable value when used in a docker image. So, to fix your problem set PYPI_API_HOSTNAME to the same value as ANSIBLE_API_HOSTNAME.

Yes setting PYPI_API_HOSTNAME helped me. Where can I get lsit of all variables which I can set in settings.py file. I could not found it in documentation

We currently have no documentation for pulp_python specific settings… (whoops, that’s my bad). For pulpcore settings you can find the variables for settings.py here. I’ll make sure to add documentation for the next pulp_python release, but currently there are two variables:

  • PYTHON_GROUP_UPLOADS - Defaults to False, changes how many tasks are spawned when performing a twine upload to Pulp. When you perform a twine upload, the sdist and bdist files are both uploaded in separate requests. This generates two tasks and creates two repository versions. Setting this value to True makes Pulp try to group these uploads together into one task so only one repository version is created. This feature is still experimental so use at your own discretion.
  • PYPI_API_HOSTNAME - Hostname to use when constructing the value for a distribution’s base_url. Defaults to socket.get_fqdn().