pairwise_distances with Cosine and weighting
Instead of using pairwise_distances you can use the pdist method to compute the distances. This will use the distance.cosine which supports weights for the values.
import numpy as np
from scipy.spatial.distance import pdist, squareform

X = np.array([[5, 4, 3], [4, 2, 1], [5, 6, 2]])
w = [1, 2, 3]

distances = pdist(X, metric='cosine', w=w)

# change the result to a square matrix
distances = squareform(distances)

Result:
array([[0.        , 0.05508882, 0.04898252],
       [0.05508882, 0.        , 0.07833123],
       [0.04898252, 0.07833123, 0.        ]])