Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
339 commits
Select commit Hold shift + click to select a range
9743498
update release_api__json
Jun 30, 2023
d728240
replace pypil with acc-py-index in acc_pypi_fronted
Jun 30, 2023
f798546
remove pypil.py
Jun 30, 2023
324d351
set configurable source
Jul 3, 2023
a190ce5
adapt package_info to the new types
Jul 4, 2023
a0e240e
improve readability
Jul 12, 2023
f90fa49
Lock the application with the acc-py-index dependency
pelson Jul 13, 2023
0d57aa8
Be sure to order the release versions
pelson Jul 13, 2023
6340f89
Merge branch 'feature/use-acc-py-index' into 'master'
pelson Jul 13, 2023
4a60f0e
allow searches with a trailing space
pelson Jul 13, 2023
eacaad9
Merge branch 'fix/search-query-space' into 'master'
pelson Jul 13, 2023
afc0655
replace mount app with mount router
Jul 13, 2023
0cc8ebd
Merge branch 'fix/url-prefix' into 'master'
pelson Jul 14, 2023
c16e6e3
Improve the printed startup message
pelson Jul 14, 2023
38c5494
Merge branch 'feature/pre-release' into 'master'
pelson Jul 14, 2023
d7bdc58
replace the function used to mount the custom router from include_rou…
Jul 14, 2023
897b6ce
Merge branch 'fix/url-prefix' into 'master'
pelson Jul 14, 2023
d80c63e
Re-architect the response to avoid exposing the JSON API and introduc…
pelson Jul 19, 2023
b8d788b
Merge branch 'no-json-api' into 'master'
pelson Jul 19, 2023
c8a14db
Crawl the top 500 projects automatically
pelson Jul 19, 2023
11e6225
Merge branch 'top-500-crawl' into 'master'
pelson Jul 19, 2023
7bac402
Cache to XDG_CACHE_HOME by default
pelson Jul 19, 2023
7726264
Merge branch 'cache_config' into 'master'
pelson Jul 19, 2023
d53f335
Rename the product in the base template
pelson Jul 19, 2023
8a4b0d8
Rename in about page
pelson Jul 19, 2023
8665f08
Remove the PyPI colours in accordance with the PSF trademark committe…
pelson Jul 20, 2023
4c3f2dc
Merge branch 'colours' into 'master'
pelson Jul 20, 2023
b27eb10
Rebrand the frontend to comply with PSF trademark requests
pelson Jul 20, 2023
397a9f1
Merge branch 'rebrand' into 'master'
pelson Jul 20, 2023
b7be6ef
Rename to simple-repository-browser
pelson Jul 20, 2023
402fe51
Rename js assets
pelson Jul 20, 2023
5c36993
Merge branch 'rename-project' into 'master'
pelson Jul 20, 2023
b77bafe
Remove gunicorn
pelson Jul 21, 2023
a482d9e
Merge branch 'uvicorn' into 'master'
pelson Jul 21, 2023
11139d6
Add a repository dumping script so that we can automate moving from i…
pelson Jul 20, 2023
549624f
Merge branch 'feature/migration-script' into 'master'
pelson Jul 21, 2023
59e024d
Standardise the spacing around the python logo, as requested by TM at…
pelson Jul 21, 2023
f0afa1e
Merge branch 'feature/standardise-logo-use' into 'master'
pelson Jul 21, 2023
f9f06bf
Correctly handle the given index-url
pelson Jul 21, 2023
52ef8a2
Merge branch 'feature/index-url-arg' into 'master'
pelson Jul 21, 2023
6cf19de
Remove the devel to be turned into test functions
pelson Jul 21, 2023
ad617ba
Remove imports that are only used for junk code
pelson Jul 21, 2023
7256be6
Merge branch 'feature/migrator-script-fix' into 'master'
pelson Jul 21, 2023
b655348
Finalised migration steps
pelson Jul 21, 2023
a8b2da8
Update the js modules
pelson Jul 21, 2023
6092099
Merge branch 'feature/migration-v10' into 'master'
pelson Jul 21, 2023
0b49b19
If available, use PEP-658 for metadata, and PEP-700 metadata for uplo…
pelson Jul 22, 2023
819c753
Merge branch 'feature/use-pep-700-metadata' into 'master'
pelson Jul 22, 2023
edd70d9
Fix the implementation of latest version, and tidy the link titles
pelson Jul 23, 2023
2b790a1
Merge branch 'feature/use-repository-api' into 'master'
pelson Jul 23, 2023
0e9bc02
Allow the acc-py-repository-browser to customise the JS and static fi…
pelson Sep 13, 2023
78037e1
Fix the freeze wheel job now that we have k8 gitlab runners
pelson Sep 13, 2023
e2d0652
Merge branch 'feature/acc-py-repo-browser-custom-css-and-static' into…
pelson Sep 13, 2023
1d9887b
Update the codebase to use the latest acc-py-index (Python 3.11) only
pelson Sep 13, 2023
d363d94
Merge branch 'feature/py311-version' into 'master'
pelson Sep 13, 2023
96345b3
Include the favicon for the Acc-Py repo
pelson Sep 13, 2023
89b3631
Build a wheel, lock and publish it for the acc-py-repo-browser project
pelson Sep 13, 2023
16d02a3
Merge branch 'feature/build-acc-py-wheel' into 'master'
pelson Sep 13, 2023
0cfd902
Ensure that the acc-py-repository-browser is correctly versioned
pelson Sep 13, 2023
332b355
Merge branch 'feature/build-acc-py-wheel' into 'master'
pelson Sep 13, 2023
a372d60
Generate the setup.py for acc-py-repository-browser from simple-repos…
pelson Sep 14, 2023
d6f0482
Allow acc_py_repository_browser.__main__ running
pelson Sep 14, 2023
cfb65b7
Merge branch 'feature/build-acc-py-wheel' into 'master'
pelson Sep 14, 2023
d96eb82
Fix failing container image build
pelson Sep 14, 2023
3eedba9
Merge branch 'feature/build-acc-py-wheel' into 'master'
pelson Sep 14, 2023
fc1e9eb
Fix the publishing step to ensure we only publish locked wheels
pelson Sep 14, 2023
f6c7d30
Merge branch 'feature/build-acc-py-wheel' into 'master'
pelson Sep 14, 2023
2aa4916
Publish step has a project root prefix
pelson Sep 14, 2023
2efcfab
Fix the wheel freezing to ensure that the correct package is installed
pelson Sep 14, 2023
f7f917f
Merge branch 'feature/build-acc-py-wheel' into 'master'
pelson Sep 14, 2023
99b501b
Continue to set the version in simple-repository-browser
pelson Sep 14, 2023
1d2b0de
Merge branch 'feature/build-acc-py-wheel' into 'master'
pelson Sep 14, 2023
ac61bbc
Fix for the build.sh script which caused one of the build repositorie…
Sep 27, 2023
08fa761
Merge branch 'fix/setup-script' into 'master'
Sep 27, 2023
3233ff2
refactor app using MVC
Sep 27, 2023
ef5dff6
add project crawler
Sep 27, 2023
2bc3d9e
move crawling functions into Crawler class
Sep 27, 2023
c0a5908
divide _app.py into multiple modules
Sep 27, 2023
01bc1e7
add create_app function, edit __main__.py
Sep 27, 2023
03beef4
refactor acc-py-browser
Sep 27, 2023
c6cccf0
fix version handling
Sep 28, 2023
091e615
add docstrings
Sep 28, 2023
8872d61
use typed dict for the model
Sep 29, 2023
7104873
fix error handling
Oct 3, 2023
83b4bd7
refactor app_build
Oct 3, 2023
044d195
use http urls instead of https
Oct 3, 2023
85567b9
Fix small issues with the refactored simple repository browser
pelson Oct 3, 2023
2d5196c
Merge branch 'feature/refactor-mvc' into 'master'
pelson Oct 3, 2023
d891e5f
Update the branding and the logo
pelson Oct 4, 2023
aee6ecf
Refine the colours to be CERN specific
pelson Oct 4, 2023
cb9ac69
Merge branch 'feature/improved-colors-and-branding' into 'master'
pelson Oct 4, 2023
919a527
Remove the internal JSON representation, and prepare the ground for m…
pelson Oct 6, 2023
b8315b7
Merge branch 'feature/remove-json-representation' into 'master'
pelson Oct 6, 2023
636bfaf
Use the component interface to allow metadata extraction from sdist a…
pelson Oct 6, 2023
6bc266a
Review improvements
pelson Oct 9, 2023
146caf8
Merge branch 'feature/metadata-injector-api' into 'master'
pelson Oct 9, 2023
259fa66
replace acc_py_index dependecy to simple_repository
Oct 10, 2023
80bcb55
update requirements and lockfile
Oct 10, 2023
b3fed2e
Merge branch 'feature/use-simple-repository-lib' into 'master'
pelson Oct 10, 2023
aacc011
fix MetadataInjector interface and calls
Oct 10, 2023
709f02e
update requirements and lockfiles
Oct 10, 2023
73fa783
Merge branch 'fix/metadata-injector' into 'master'
pelson Oct 11, 2023
527f8f0
Auto-escape the template
pelson Oct 11, 2023
2055c2e
Merge branch 'feature/autoescape' into 'master'
pelson Oct 11, 2023
78cbd54
Remove custom description sanitising, in favor of fully using readme …
pelson Oct 11, 2023
116008c
Handle plain text descriptions
pelson Oct 11, 2023
67506b6
Merge branch 'feature/autoescape' into 'master'
pelson Oct 11, 2023
5ab1cee
Increase the number of handled weblink names (for indico project), an…
pelson Oct 11, 2023
f9b1e38
Merge branch 'feature/weblink-improvements' into 'master'
pelson Oct 11, 2023
fb38083
Introduce next/previous links for search results. No nice styling at …
pelson Oct 11, 2023
5826e52
Simplify the error when no query specified
pelson Oct 11, 2023
416749e
Styleise the pages links
pelson Oct 11, 2023
cb0ad13
Merge branch 'feature/search-pagination' into 'master'
pelson Oct 11, 2023
a4bcf6b
Only show pagination of search results when there is more than one page
pelson Oct 11, 2023
f8ea67e
Merge branch 'feature/search-pagination' into 'master'
pelson Oct 11, 2023
d0613ed
Re-lock the application
pelson Oct 11, 2023
0090d66
Merge branch 'feature/search-pagination' into 'master'
pelson Oct 11, 2023
5deadc8
Drop the reqdist-hash, which appears to be producing different hashes…
pelson Oct 11, 2023
42354ae
Merge branch 'feature/search-pagination' into 'master'
pelson Oct 11, 2023
3ee36b1
Prepare for a new repository dump
pelson Oct 12, 2023
3380141
Merge branch 'feature/search-pagination' into 'master'
pelson Oct 12, 2023
af1ed01
Fix lint
pelson Oct 13, 2023
3bdf8eb
Merge branch 'feature/search-pagination' into 'master'
pelson Oct 13, 2023
aba059a
Improve the README strapline
pelson Oct 14, 2023
752e8e7
Update the project page model to include richer release info, and dis…
pelson Oct 14, 2023
4bed651
Enable strict jinja variable usage
pelson Oct 16, 2023
2cff2f0
Refine the implementation, and fix an issue with real-world usage
pelson Oct 16, 2023
07f66eb
Merge branch 'feature/release-metadata' into 'master'
pelson Oct 16, 2023
4446fa6
Refine the frontend JS
pelson Oct 16, 2023
9b34d15
Merge branch 'feature/release-metadata' into 'master'
pelson Oct 16, 2023
f080477
Allow filtering of extras, and hide all extra dependencies by default
pelson Oct 16, 2023
f082082
Merge branch 'feature/release-metadata' into 'master'
pelson Oct 16, 2023
8617a0b
Display yanked status
pelson Oct 16, 2023
ca5138e
Merge branch 'feature/release-metadata' into 'master'
pelson Oct 16, 2023
12a84b3
relock file with new version of devtools
Oct 17, 2023
d915ca9
Merge branch 'fix/lockfile' into 'master'
Oct 17, 2023
ab38608
Introduce a compatibility matrix based on the available files
pelson Oct 16, 2023
ab83feb
Add a test for an unusual ABI3 wheel
pelson Oct 18, 2023
75917fb
ci: add internal mypy hook
Pinzauti Oct 18, 2023
c4f7f5d
Merge branch 'master' into 'master'
Pinzauti Oct 19, 2023
e2de2ef
Prepare the model for compatibility before sending the domain object …
pelson Oct 20, 2023
b53533d
Merge branch 'feature/compatibility-matrix' into 'master'
pelson Oct 20, 2023
0ac46bf
Don't show partial yanked releases in the header and release section …
pelson Oct 20, 2023
e6130ef
Merge branch 'feature/refinement-pre-release' into 'master'
pelson Oct 20, 2023
2ad118e
Re-lock the application
pelson Oct 20, 2023
284fa1d
Merge branch 'feature/refinement-pre-release' into 'master'
pelson Oct 20, 2023
fd3defb
fix mypy issues
Oct 30, 2023
c965273
Apply 1 suggestion(s) to 1 file(s)
Oct 31, 2023
5efed22
Merge branch 'fix/mypy' into 'master'
Oct 31, 2023
4a6c002
Use relative URLs from url_for
pelson Nov 1, 2023
389f8cd
Merge branch 'feature/relative-url' into 'master'
pelson Nov 1, 2023
7b228eb
Migrate to httpx and simple-repository>=0.4
Oct 30, 2023
8f7f882
Merge branch 'migrate/httpx' into 'master'
pelson Nov 1, 2023
9baa05e
Allow template paths to be passed to the CLI, allowing rudimentary cu…
pelson Nov 1, 2023
6d6fe05
Merge branch 'feature/templates-from-cli' into 'master'
pelson Nov 1, 2023
7c614eb
Provide a customisation so that we can run a public version of the br…
pelson Nov 1, 2023
f3c1b35
Merge branch 'feature/temporary-public-service' into 'master'
Nov 1, 2023
38c55ea
Improve controller Router by adding Route class in order to make exte…
Nov 1, 2023
43a99d8
add authentication to the acc-py repository browser
Nov 1, 2023
f8f0127
update requirements
Nov 1, 2023
2af6e4c
redirect to current page after login/logout operation
Nov 3, 2023
50e7a22
Merge branch 'feature/authentication' into 'master'
pelson Nov 3, 2023
466bfa4
Fix the search URL pagination
pelson Nov 6, 2023
b668f90
Merge branch 'feature/fix-search-url' into 'master'
pelson Nov 6, 2023
58d93a7
Replace prints with logging
pelson Nov 6, 2023
5cf8de1
Merge branch 'feature/logging' into 'master'
pelson Nov 6, 2023
e41c476
Rename index to repository everywhere, and accept file based repository
pelson Nov 6, 2023
e28b3dd
Merge branch 'feature/rename-index-and-support-file' into 'master'
pelson Nov 6, 2023
85407da
move source from classifier to dedicated slot in the sidebar
Nov 7, 2023
0affb7f
Show ownership in the project page
Dec 1, 2023
b38cc78
Merge branch 'feature/source-repo-custom-sidebar' into 'master'
pelson Dec 4, 2023
3aec3db
Merge branch 'feature/project-page-ownership' into 'master'
pelson Dec 4, 2023
833efc8
Dispaly in user page owned packages
Dec 7, 2023
a0a8aee
improve user page
Dec 7, 2023
40d1db1
Rename owned_projects to owned_resources
Dec 14, 2023
66f7b28
Merge branch 'feature/owned-projects-page' into 'master'
Dec 14, 2023
e586172
Add manage project page
Dec 14, 2023
4b06a63
Move manage script into a dedicated file
Jan 9, 2024
1d423cb
Merge branch 'feature/manage-page' into 'master'
pelson Jan 12, 2024
0ee76d3
Be more robust to invalid requirement specifications. Examples seen i…
pelson Jan 18, 2024
1a73c65
Remove the logout button, and improve the bootstrap use for navbar
pelson Jan 18, 2024
841162b
Merge branch 'feature/login-link-style' into 'master'
pelson Jan 18, 2024
91a9d96
Remove some of the style usage
pelson Jan 22, 2024
c5de4f8
Add an is_valid attribute to Requirement, for ease of use within temp…
pelson Jan 22, 2024
2b554f8
Update requirements and lockfiles
Jan 23, 2024
65584bb
Adapt MetadataInjector to newer interface
Jan 23, 2024
5bd2028
Remove authorization from manage page
Jan 23, 2024
5ff7a96
Merge branch 'update/simple-repository-v0.6' into 'master'
pelson Jan 23, 2024
973a8af
Merge branch 'feature/handle-invalid-specs' into 'master'
pelson Jan 23, 2024
c8b9081
Merge branch 'fix/remove-authorization-from-manage-page' into 'master'
pelson Jan 23, 2024
15928db
Allow users to yank their packages using from the manage page
Jan 11, 2024
0fca477
Merge branch 'feature/yank-pannel' into 'master'
pelson Jan 23, 2024
e39ac12
Allow users to add owners via the UI
Jan 24, 2024
f3187ff
Merge branch 'feature/add-project-owners' into 'master'
pelson Jan 26, 2024
982e50a
Bump FastAPI to 0.110 to fix memory leak on 500
Feb 26, 2024
be49f39
Merge branch 'fix/mem-leak' into 'master'
pelson Feb 26, 2024
76ebcd6
Support requests to non-canonical URLs, whilst optimising the number …
pelson Feb 26, 2024
2d68bbf
Merge branch 'fix/non-normalized-url' into 'master'
pelson Feb 26, 2024
13e20c7
Redirect if visiting the root of the site when a prefix is used
pelson Feb 26, 2024
0f9394a
Merge branch 'fix/non-normalized-url' into 'master'
pelson Feb 26, 2024
5ceeee2
Migrate to EL9 images
Jun 14, 2024
10ebb64
Merge branch 'el9' into 'master'
pelson Jun 14, 2024
12368de
Move to pyproject.toml
pelson Jun 27, 2024
8bcf62e
Update the preparation script
pelson Jun 27, 2024
d62501f
Handle the Acc-Py repo browser build
pelson Jun 27, 2024
33a3f78
Use el9 for building node requirements
pelson Jun 27, 2024
45b7b33
Merge branch 'feature/pyproject' into 'master'
pelson Jun 27, 2024
8ace70f
Add rotating file logs in the acc-py browser
Jul 8, 2024
96e485e
Merge branch 'feature/log-to-file' into 'master'
Jul 8, 2024
a80ee79
Include the static js assets, which weren't included due to them not …
pelson Oct 7, 2024
2dfd382
Merge branch 'fix/package-data' into 'master'
pelson Oct 7, 2024
3b72cde
Update the repo preparation script to include the copyright headers
pelson Oct 7, 2024
f2bd993
Merge branch 'feature/prepare-repo' into 'master'
pelson Oct 7, 2024
f268213
Force pkginfo to be updated in order to handle metadata 2.4
pelson Mar 24, 2025
dec4161
Merge branch 'feature/fix-rendering' into 'master'
pelson Mar 24, 2025
dc6099e
Fix rendering of isort 5.11.3. Closes https://gitlab.cern.ch/acc-co/d…
pelson Mar 24, 2025
5c1fe30
Merge branch 'feature/fix-rendering' into 'master'
pelson Mar 24, 2025
4bea62a
Lock the acc-py-browser separately, since it may have different requi…
pelson Apr 2, 2025
c2b4b5b
Update the build script to not remove deploy
pelson Apr 2, 2025
a300a69
Merge branch 'feature/fix-rendering' into 'master'
pelson Apr 2, 2025
e537333
Include the templates explicitly. This is necessary for the acc-py-br…
pelson Apr 2, 2025
876a2f5
Merge branch 'feature/fix-rendering' into 'master'
pelson Apr 2, 2025
df9be9c
Fix rendering of some legacy requirement specification format
pelson Jun 4, 2025
7477ed9
Fix the pre-commit issues identified
pelson Jun 4, 2025
9f11391
Merge branch 'feature/fix-rendering' into 'master'
pelson Jun 4, 2025
afccf0b
Improve logging format, and ensure that we have the correct IP when b…
pelson Jun 4, 2025
ebd7d12
Merge branch 'feature/fix-rendering' into 'master'
pelson Jun 4, 2025
44f8ca9
Include the missing images from the Acc-Py build
pelson Jun 4, 2025
c7cfd24
Merge branch 'feature/fix-rendering' into 'master'
pelson Jun 4, 2025
03142dc
Stop jumping to the files tab when clicking on the docs link
pelson Jun 4, 2025
d941cc8
Merge branch 'feature/fix-rendering' into 'master'
pelson Jun 4, 2025
6cf5d1b
Build image from source, and improve the logs
pelson Jun 5, 2025
7b702ad
Handle the upstream repository quarantining files for a period
pelson Mar 6, 2025
9baa058
Display the quarantine information, and improve the tooltips for yank…
pelson Jun 11, 2025
9b838a5
Fix bug with upload time calculation for quarantine
pelson Jun 12, 2025
817eda5
Merge branch 'feature/quarantine-handling' into 'master'
pelson Jun 12, 2025
a037be9
Update acc-py-repository-browser deployment, and stop building a cont…
pelson Jun 12, 2025
b8b3dd8
Re-use the functionality provided by the templates
pelson Jun 12, 2025
7fc2c70
Merge branch 'feature/quarantine-handling' into 'master'
pelson Jun 12, 2025
d8a7936
Merge branch 'feature/fix-rendering' into 'master'
pelson Jun 12, 2025
06f9536
Fix the case where a release has only pre-releases, as before this ch…
pelson Jun 12, 2025
b426416
Merge branch 'feature/quarantine-handling' into 'master'
pelson Jun 13, 2025
f8435ab
Cease using scss (use css variables instead), and ship the CSS direct…
pelson Jun 13, 2025
1823671
Implement static file handling
pelson Jun 13, 2025
505b6a2
Merge branch 'feature/simpler-theming' into 'master'
pelson Jun 13, 2025
8c46ef8
Make acc-py-repository-browser depend on simple-repository-browser, r…
pelson Jun 16, 2025
7160c38
Adapt for isort changes as a result of dependency changes
pelson Jun 16, 2025
041c01f
Ignore the generated version file in acc-py-repository-browser
pelson Jun 16, 2025
e3837ed
Merge branch 'feature/acc-py-has-simple-repo-browser-dep' into 'master'
pelson Jun 16, 2025
7f9e11b
Merge the internal repository, and bring in the full history. GitHub …
pelson Jun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
simple_repository_browser/static_source/js/simple-repository-browser.project.js.LICENSE.txt
simple_repository_browser/static_source/js/simple-repository-browser.core.js.LICENSE.txt
simple_repository_browser/static_source/js/simple-repository-browser.core.js
simple_repository_browser/static_source/js/simple-repository-browser.project.js

*/_version.py
node_modules
*.egg-info
venv
*.sqlite
cache
logs


__pycache__

.idea
simple_repository_browser/_version.py
simple_repository_browser/static/js
javascript/node_modules

build/
dist/
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ repos:
- id: flake8
args:
- "--max-line-length=100"
- '--ignore=E501,E226'
- '--ignore=E501,E226,W503,E402'
142 changes: 0 additions & 142 deletions javascript/scss/app.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "variables";

// Limit the width as seen on pypi.
$container-max-widths: (
sm: 540px,
Expand All @@ -10,143 +8,3 @@ $container-max-widths: (
);

@import "~bootstrap/scss/bootstrap";

.top-nav {
background: $base-color;
}

.nav-link {
color: white;
}

.nav-link:hover, .nav-link:focus {
color: white;
}

.navbar-brand {
font-size: xx-large;
color: white;
font-weight: bolder;
}
.navbar-brand:hover {
text-decoration: none;
color: white;
}

.jumbo-banner {
background: $base-color2;
color: white;
padding: 0px;
margin: 0px;
}

.jumbo-separator {
background-color: #ececec;
color: #464646;
border-bottom: 1px solid #d3d3d3;
padding: 1em;
margin-bottom: 1em;
}


a:hover, a:visited, a:link, a:active
{
text-decoration: none;
}


.btn-link {
text-decoration: none;
}

nav a:hover {
text-decoration: underline;
}

.pip-command {
font-family: Source Code Pro, monospace;
font-weight: 500;
font-size: 1.2rem;
background-color: rgba(0, 0, 0, .15);
padding: 8px;
border: 1px dotted hsla(0, 0%, 100%, .4);
line-height: 30px;
white-space: nowrap; // Long pip commands shouldn't wrap
}

.pip-command a, .pip-command a:hover {
color: white;
}

.listing-icon {
padding: 0 1em 0 0.5em;
}

footer {
background-color: $base-color;
color: white;
padding: 2em;
}

footer.text-muted.mt-auto {
color: white !important;
margin-top: 2em !important;
}

.btn-primary, .btn-primary:hover, .btn-primary:active, .btn-primary:focus {
background-color: $base-color;
border-color: $base-color;
box-shadow: none; // On focus otherwise
}

dev#page-content a:hover {
color: $base-color;
}


a.status-badge {
font-weight: 400;
line-height: 1.4;
border: 1px solid hsla(0, 0%, 100%, .5);
border-radius: 3px;
box-sizing: border-box;
display: inline-flex;
font-size: .8rem;
min-height: 40px;
padding: 12px;
color: #fff;
}

a.status-badge--bad {
background-color: #d52d40;
}

a.status-badge--good {
background-color: #148024;
}

img {
max-width: 100%;
}


.link-unstyled, .link-unstyled:link, .link-unstyled:hover {
color: inherit;
text-decoration: inherit;
}


.base-color {
background: $base-color !important;
color: white !important;
}

.secondary-color {
background: $base-color2 !important;
color: white !important;
}


.m-1em {
margin: 1em;
}
14 changes: 5 additions & 9 deletions javascript/simple-repository-browser.core.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
/*
* Copyright (C) 2023, CERN
* This software is distributed under the terms of the MIT
* licence, copied verbatim in the file "LICENSE".
* In applying this license, CERN does not waive the privileges and immunities
* granted to it by virtue of its status as Intergovernmental Organization
* or submit itself to any jurisdiction.
*/
import './scss/app.scss';

import 'popper.js'; // Needed for bootstrap tooltips.

import 'bootstrap';

import './scss/app.scss';
// Expose bootstrap, so that we can initiate some events with it (like enabling tooltips).
window.bootstrap = require('bootstrap/dist/js/bootstrap.bundle.js');
9 changes: 0 additions & 9 deletions javascript/simple-repository-browser.project.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/*
* Copyright (C) 2023, CERN
* This software is distributed under the terms of the MIT
* licence, copied verbatim in the file "LICENSE".
* In applying this license, CERN does not waive the privileges and immunities
* granted to it by virtue of its status as Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

import $ from 'jquery';
window.jQuery = $;
window.$ = $;
Expand Down
11 changes: 1 addition & 10 deletions javascript/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/*
* Copyright (C) 2023, CERN
* This software is distributed under the terms of the MIT
* licence, copied verbatim in the file "LICENSE".
* In applying this license, CERN does not waive the privileges and immunities
* granted to it by virtue of its status as Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

const path = require('path');

module.exports = {
Expand All @@ -16,7 +7,7 @@ module.exports = {
},
output: {
filename: '[name]',
path: path.resolve(__dirname, '../simple_repository_browser/static/js/')
path: path.resolve(__dirname, '../simple_repository_browser/static_source/js/')
},
resolve: {
extensions: [".ts", ".js"],
Expand Down
17 changes: 14 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ dependencies = [
"markupsafe",
"packaging",
"parsley",
"pkginfo",
"pkginfo>=1.12",
"readme-renderer[md]",
"simple-repository>=0.6",
"simple-repository~=0.9",
"uvicorn",
"authlib",
"starlette[full]",
]
readme = "README.md"

Expand All @@ -50,14 +52,23 @@ dev = [
[project.scripts]
simple-repository-browser = "simple_repository_browser.__main__:main"


[tool.setuptools_scm]
version_file = "simple_repository_browser/_version.py"

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 88
force_sort_within_sections = true

[[tool.mypy.overrides]]
module = [
"diskcache",
"parsley",
"setuptools",
]
ignore_missing_imports = true

Expand Down
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pathlib
import sys

from setuptools import setup

sys.path.insert(0, 'simple_repository_browser')
from _compile_static import compile_static_files # type: ignore[import-not-found]

root = pathlib.Path(__file__).parent

static_dir = root / 'simple_repository_browser' / 'static_source'
dest = root / 'simple_repository_browser' / 'static'

compile_static_files(destination=dest, sources=[static_dir])

setup()
12 changes: 11 additions & 1 deletion simple_repository_browser/__main__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import argparse
import logging
import os
import typing
from pathlib import Path
import typing

import uvicorn
from uvicorn.config import LOGGING_CONFIG

from . import __version__
from ._app import AppBuilder
Expand Down Expand Up @@ -47,10 +48,19 @@ def handler(args: typing.Any) -> None:
browser_version=__version__,
).create_app()

log_conf = LOGGING_CONFIG.copy()
log_conf["formatters"]["default"]["fmt"] = "%(asctime)s [%(name)s] %(levelprefix)s %(message)s"
log_conf["formatters"]["access"][
"fmt"
] = '%(asctime)s [%(name)s] %(levelprefix)s %(client_addr)s - "%(request_line)s" %(status_code)s'

uvicorn.run(
app=app,
host=args.host,
port=args.port,
proxy_headers=True,
forwarded_allow_ips="*",
log_config=log_conf,
)


Expand Down
4 changes: 2 additions & 2 deletions simple_repository_browser/_app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from pathlib import Path
import sqlite3
import typing
from pathlib import Path
from urllib.parse import urlparse

import aiosqlite
Expand Down Expand Up @@ -107,7 +107,7 @@ async def catch_exceptions_middleware(request: fastapi.Request, call_next):
return app

def create_view(self) -> view.View:
return view.View(self.template_paths, self.browser_version)
return view.View(self.template_paths, self.browser_version, static_files_path=self.static_files_path)

def create_crawler(self, http_client: httpx.AsyncClient, source: SimpleRepository) -> crawler.Crawler:
return crawler.Crawler(
Expand Down
41 changes: 41 additions & 0 deletions simple_repository_browser/_compile_static.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

from hashlib import sha256
import json
import pathlib
from pprint import pprint
import shutil
import typing


def compile_static_files(*, destination: pathlib.Path, sources: typing.Sequence[pathlib.Path]):
"""Compile a static directory from one or more source directories."""
files_to_compile = {}
for source in sources:
assert source.exists()
for path in sorted(source.glob('**/*')):
if not path.is_file():
continue
if path.name.startswith('.'):
continue
rel = path.relative_to(source)
files_to_compile[rel] = path

print('Compiled static sources:')
pprint(files_to_compile)

manifest = {}
for rel, source_path in files_to_compile.items():
target_dir = (destination / rel).parent
target_dir.mkdir(parents=True, exist_ok=True)

file_hash = sha256(source_path.read_bytes()).hexdigest()[:12]
name = f'{source_path.stem}.{file_hash}{source_path.suffix}'
manifest[str(rel)] = str(rel.parent / name)
shutil.copy(source_path, target_dir / name)

json.dump({'file-map': manifest}, (destination / '.manifest.json').open('w'), indent=2)
(destination / '.gitignore').write_text('*')


if __name__ == '__main__':
pass
2 changes: 1 addition & 1 deletion simple_repository_browser/_search.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import dataclasses
from enum import Enum
import re
import textwrap
import typing
from enum import Enum

import parsley

Expand Down
Loading