Skip to content

Commit 729e690

Browse files
authored
Merge pull request #235 from CodeHeeler/issue-4677
Fixes relative_path so pip can install packages
2 parents 3a02a9b + bb3de73 commit 729e690

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/workflows/publish-host.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ Use the newly created distribution
7575

7676
The metadata and packages can now be retrieved from the distribution::
7777

78-
$ http $BASE_ADDR/pulp/content/foo/simple/
79-
$ http $BASE_ADDR/pulp/content/foo/simple/shelf-reader/
78+
$ http $CONTENT_ADDR/pulp/content/foo/simple/
79+
$ http $CONTENT_ADDR/pulp/content/foo/simple/shelf-reader/
8080

8181
The content is also pip installable::
8282

83-
$ pip install --trusted-host localhost -i $BASE_ADDR/pulp/content/foo/simple/ shelf-reader
83+
$ pip install --trusted-host localhost -i $CONTENT_ADDR/pulp/content/foo/simple/ shelf-reader
8484

8585
If you don't want to specify the distribution path every time, you can modify your ``pip.conf``
8686
file. See the `pip docs <https://pip.pypa.io/en/stable/user_guide/#configuration>`_ for more

pulp_python/app/tasks/publish.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def write_simple_api(publication):
8383
publication (pulpcore.plugin.models.Publication): A publication to generate metadata for
8484
8585
"""
86-
simple_dir = 'simple'
86+
simple_dir = 'simple/'
8787
os.mkdir(simple_dir)
8888
project_names = (
8989
python_models.PythonPackageContent.objects.filter(
@@ -97,7 +97,7 @@ def write_simple_api(publication):
9797
index_names = [(name, canonicalize_name(name)) for name in project_names]
9898

9999
# write the root index, which lists all of the projects for which there is a package available
100-
index_path = '{simple_dir}/index.html'.format(simple_dir=simple_dir)
100+
index_path = '{simple_dir}index.html'.format(simple_dir=simple_dir)
101101
with open(index_path, 'w') as index:
102102
context = Context({'projects': index_names})
103103
template = Template(simple_index_template)
@@ -111,7 +111,7 @@ def write_simple_api(publication):
111111
index_metadata.save()
112112

113113
for (name, canonical_name) in index_names:
114-
project_dir = '{simple_dir}/{name}'.format(simple_dir=simple_dir, name=canonical_name)
114+
project_dir = '{simple_dir}{name}/'.format(simple_dir=simple_dir, name=canonical_name)
115115
os.mkdir(project_dir)
116116

117117
packages = python_models.PythonPackageContent.objects.filter(name=name)
@@ -132,7 +132,7 @@ def write_simple_api(publication):
132132
path = "../../{}".format(package.filename)
133133
package_detail_data.append((package.filename, path, checksum))
134134

135-
metadata_relative_path = '{project_dir}/index.html'.format(project_dir=project_dir)
135+
metadata_relative_path = '{project_dir}index.html'.format(project_dir=project_dir)
136136

137137
with open(metadata_relative_path, 'w') as simple_metadata:
138138
context = Context({

0 commit comments

Comments
 (0)